diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-23 22:41:15 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-23 22:41:15 -0400 |
commit | 5126d56b3992acd3193aaae35f178bb5e9da1cae (patch) | |
tree | da02a80055aef9df253f0c4a1679884789562f87 /src/SMAPI/Program.cs | |
parent | fad47ff74f6d03652951230eb1c394b896578c48 (diff) | |
download | SMAPI-5126d56b3992acd3193aaae35f178bb5e9da1cae.tar.gz SMAPI-5126d56b3992acd3193aaae35f178bb5e9da1cae.tar.bz2 SMAPI-5126d56b3992acd3193aaae35f178bb5e9da1cae.zip |
fix error when a mod removes an asset editor/loader (#460)
Diffstat (limited to 'src/SMAPI/Program.cs')
-rw-r--r-- | src/SMAPI/Program.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 8c1ea238..1b8cb2ba 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -953,7 +953,7 @@ namespace StardewModdingAPI { helper.ObservableAssetEditors.CollectionChanged += (sender, e) => { - if (e.NewItems.Count > 0) + if (e.NewItems?.Count > 0) { this.Monitor.Log("Invalidating cache entries for new asset editors...", LogLevel.Trace); this.ContentCore.InvalidateCacheFor(e.NewItems.Cast<IAssetEditor>().ToArray(), new IAssetLoader[0]); @@ -961,7 +961,7 @@ namespace StardewModdingAPI }; helper.ObservableAssetLoaders.CollectionChanged += (sender, e) => { - if (e.NewItems.Count > 0) + if (e.NewItems?.Count > 0) { this.Monitor.Log("Invalidating cache entries for new asset loaders...", LogLevel.Trace); this.ContentCore.InvalidateCacheFor(new IAssetEditor[0], e.NewItems.Cast<IAssetLoader>().ToArray()); |