From 4db7ca28f68be2e25b565a1b98e2c05fb42a5a88 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 25 Jan 2020 11:05:36 -0500 Subject: fix error building/demolishing buildings for some players --- docs/release-notes.md | 1 + src/SMAPI/Framework/SnapshotListDiff.cs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 970f26f1..d8ff8f6a 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,6 +10,7 @@ * Fixed 'collection was modified' error when returning to title in rare cases. * Fixed update-check error if a mod's Chucklefish page has no version. * Fixed SMAPI beta versions not showing update alert on next launch (thanks to danvolchek!). + * Fixed rare error when building/demolishing buildings. * For the Console Commands mod: * Added `test_input` command to view button codes in the console. diff --git a/src/SMAPI/Framework/SnapshotListDiff.cs b/src/SMAPI/Framework/SnapshotListDiff.cs index d4d5df50..2d0efa0d 100644 --- a/src/SMAPI/Framework/SnapshotListDiff.cs +++ b/src/SMAPI/Framework/SnapshotListDiff.cs @@ -42,10 +42,12 @@ namespace StardewModdingAPI.Framework this.IsChanged = isChanged; this.RemovedImpl.Clear(); - this.RemovedImpl.AddRange(removed); + if (removed != null) + this.RemovedImpl.AddRange(removed); this.AddedImpl.Clear(); - this.AddedImpl.AddRange(added); + if (added != null) + this.AddedImpl.AddRange(added); } /// Update the snapshot. -- cgit