From 90f72f15557ac4912009b74b52fc387a62a04286 Mon Sep 17 00:00:00 2001 From: Ryan Kistner Date: Wed, 23 Jan 2013 16:35:44 -0700 Subject: [PATCH] DepotDownloader: added some error handling --HG-- extra : rebase_source : f849aa26ef59c3eb260b0727ab0f9e7d36700fab --- DepotDownloader/CDRManager.cs | 3 +++ DepotDownloader/ContentDownloader.cs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/DepotDownloader/CDRManager.cs b/DepotDownloader/CDRManager.cs index 22ffd2de..e2e844d2 100644 --- a/DepotDownloader/CDRManager.cs +++ b/DepotDownloader/CDRManager.cs @@ -269,6 +269,9 @@ namespace DepotDownloader else if ( Util.IsMacOSX() ) platformStr = "macos"; + if (appInfoBlob.FileSystems == null) + return depotIDs; + foreach ( var blobField in appInfoBlob.FileSystems ) { string depotPlatform = blobField.Platform; diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index ee262a5f..baa13d24 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -645,6 +645,12 @@ namespace DepotDownloader } steam3.RequestDepotKey( ( uint )depotId, ( uint )appId ); + if (!steam3.DepotKeys.ContainsKey((uint)depotId)) + { + Console.WriteLine("No valid depot key for {0}, unable to download.", depotId); + return null; + } + byte[] depotKey = steam3.DepotKeys[(uint)depotId]; var info = new DepotDownloadInfo3( depotId, manifestID, installDir, contentName );