Skip to content

Commit 41b3ca8

Browse files
committed
Add null checks to MASMonitor EnablePage() and DisablePage()
If Start() fails, currentPage is probably null. I already added null checks or exception traps where it's otherwise accessed. Addresses log spam from Issue #343
1 parent bb6cf47 commit 41b3ca8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/MASMonitor.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class MASMonitor : InternalModule
9090
/// <param name="cam"></param>
9191
private void EnablePage(Camera cam)
9292
{
93-
if (cam.Equals(screenCamera))
93+
if (currentPage != null && cam.Equals(screenCamera))
9494
{
9595
currentPage.RenderPage(true);
9696
}
@@ -105,7 +105,7 @@ private void EnablePage(Camera cam)
105105
/// <param name="cam"></param>
106106
private void DisablePage(Camera cam)
107107
{
108-
if (cam.Equals(screenCamera))
108+
if (currentPage != null && cam.Equals(screenCamera))
109109
{
110110
currentPage.RenderPage(false);
111111
}

0 commit comments

Comments
 (0)