Skip to content

Commit

Permalink
Fixed error spam from the StorageContainer patcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-taylor committed Dec 26, 2018
1 parent 7e45281 commit 102ecbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ResourceMonitor/Components/ResourceMonitorLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private void TrackExistingStorageContainers()

public void AlertedNewStorageContainerPlaced(StorageContainer sc)
{
System.Console.WriteLine("[ERROR] sc is null ? " + (sc == null ? "its null" : "its not null"));
StartCoroutine("TrackNewStorageContainerCoroutine", sc);
}

Expand Down
5 changes: 4 additions & 1 deletion ResourceMonitor/Patchers/BuilderPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public class BuilderPatcher
[HarmonyPostfix]
public static void Postfix(StorageContainer __instance)
{
OnStorageContainedAdded.Invoke(__instance);
if (OnStorageContainedAdded != null)
{
OnStorageContainedAdded.Invoke(__instance);
}
}
}
}

0 comments on commit 102ecbc

Please sign in to comment.