Skip to content

Commit

Permalink
Add null checks to MASMonitor EnablePage() and DisablePage()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MOARdV committed Dec 13, 2021
1 parent bb6cf47 commit 41b3ca8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/MASMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class MASMonitor : InternalModule
/// <param name="cam"></param>
private void EnablePage(Camera cam)
{
if (cam.Equals(screenCamera))
if (currentPage != null && cam.Equals(screenCamera))
{
currentPage.RenderPage(true);
}
Expand All @@ -105,7 +105,7 @@ private void EnablePage(Camera cam)
/// <param name="cam"></param>
private void DisablePage(Camera cam)
{
if (cam.Equals(screenCamera))
if (currentPage != null && cam.Equals(screenCamera))
{
currentPage.RenderPage(false);
}
Expand Down

0 comments on commit 41b3ca8

Please sign in to comment.