Skip to content

Commit 66689c5

Browse files
Merge pull request #9 from linuxgurugamer/linuxgurugamer-patch-1
Fix Nullrefs which occur when using KRASH
2 parents e54d322 + b97c5f2 commit 66689c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ClickThroughBlocker/ClickThroughBlocker.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ internal void PreventEditorClickthrough(Rect r)
6262
#if DUMMY
6363
return;
6464
#else
65-
if (lockName == null)
65+
if (lockName == null || EditorLogic.fetch == null)
6666
return;
6767
//Log.Info("ClickThruBlocker: PreventEditorClickthrough");
6868
bool mouseOverWindow = MouseIsOverWindow(r);
@@ -129,7 +129,7 @@ internal void OnDestroy()
129129
else
130130
InputLockManager.RemoveControlLock(lockName);
131131
}
132-
if (weLockedEditorInputs)
132+
if (EditorLogic.fetch != null && weLockedEditorInputs)
133133
{
134134
//EditorLogic.fetch.Unlock(lockName);
135135
weLockedEditorInputs = false;
@@ -475,7 +475,7 @@ private void DoGuiCounter()
475475
{
476476
//Log.Info("lastonGuiCnt: " + lastonGuiCnt + "lastLockCycle: " + win.lastLockCycle);
477477
{
478-
if (win.weLockedEditorInputs)
478+
if (if (EditorLogic.fetch != null && win.weLockedEditorInputs)
479479
{
480480
EditorLogic.fetch.Unlock(win.lockName);
481481
win.weLockedEditorInputs = false;
@@ -493,4 +493,4 @@ private void DoGuiCounter()
493493
}
494494
}
495495
#endif
496-
}
496+
}

0 commit comments

Comments
 (0)