mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-20 01:46:21 +00:00
Fix regioninfo watcher crashing when the file doesn't exist
This commit is contained in:
1 file changed
+1
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user