Fix regioninfo watcher crashing when the file doesn't exist

This commit is contained in:
js6pak committed 2022-07-29 21:17:17 +02:00
1 parent ef6baeacce
commit ff7a80addf
1 file changed
+1 -2
+1 -2
View File
@@ -67,8 +67,7 @@ namespace Reactor.Patches
// file again, stop AU from actually writing it.
if (ServerManager.Instance && path == ServerManager.Instance.serverInfoFileJson)
{
var currentContents = FileIO.ReadAllText(path);
var continueWrite = currentContents != contents;
var continueWrite = !FileIO.Exists(path) || FileIO.ReadAllText(path) != contents;
Logger<ReactorPlugin>.Debug($"Continue serverInfoFile write? {continueWrite}");
// If we will write, ignore the next change action from the observer.
PluginSingleton<ReactorPlugin>.Instance.RegionInfoWatcher.IgnoreNext = continueWrite;