summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Commands
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-11-10 20:11:52 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-11-10 20:11:52 -0500
commit947d4545b1326bf6afbfb970d979dafd8ff2eb97 (patch)
tree213d253685f91312c5b67c7a87a645b4ba88c239 /src/SMAPI/Framework/Commands
parentec84ba07cc80c74ed0c997550a401def6ea24916 (diff)
downloadSMAPI-947d4545b1326bf6afbfb970d979dafd8ff2eb97.tar.gz
SMAPI-947d4545b1326bf6afbfb970d979dafd8ff2eb97.tar.bz2
SMAPI-947d4545b1326bf6afbfb970d979dafd8ff2eb97.zip
fix 'collection was modified' error when using 'harmony summary' command in rare cases
Diffstat (limited to 'src/SMAPI/Framework/Commands')
-rw-r--r--src/SMAPI/Framework/Commands/HarmonySummaryCommand.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/Commands/HarmonySummaryCommand.cs b/src/SMAPI/Framework/Commands/HarmonySummaryCommand.cs
index 8fdd4282..f3731d16 100644
--- a/src/SMAPI/Framework/Commands/HarmonySummaryCommand.cs
+++ b/src/SMAPI/Framework/Commands/HarmonySummaryCommand.cs
@@ -112,9 +112,9 @@ namespace StardewModdingAPI.Framework.Commands
private IEnumerable<SearchResult> GetAllPatches()
{
#if HARMONY_2
- foreach (MethodBase method in Harmony.GetAllPatchedMethods())
+ foreach (MethodBase method in Harmony.GetAllPatchedMethods().ToArray())
#else
- foreach (MethodBase method in this.HarmonyInstance.GetPatchedMethods())
+ foreach (MethodBase method in this.HarmonyInstance.GetPatchedMethods().ToArray())
#endif
{
// get metadata for method