Skip to content

Commit

Permalink
Add preventive check in filter interface against non-existent KSP int…
Browse files Browse the repository at this point in the history
…erface during loading
  • Loading branch information
KSP-TaxiService committed Jan 3, 2021
1 parent a20ad38 commit f14e5d0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/RemoteTech/UI/FilterOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ private Rect Position
mImg = obj.GetChild("bg (stretch)").GetComponent<UnityEngine.UI.Image>();
}

posX = mImg.rectTransform.rect.width * GameSettings.UI_SCALE;
if (mImg != null)
{
posX = mImg.rectTransform.rect.width * GameSettings.UI_SCALE;
}
}

return new Rect(posX, posY, mTextures.Background.width * GameSettings.UI_SCALE, mTextures.Background.height * GameSettings.UI_SCALE);
Expand All @@ -104,7 +107,11 @@ private Rect PositionSatellite
if(obj != null)
mImg = obj.GetChild("bg (stretch)").GetComponent<UnityEngine.UI.Image>();
}
posX = mImg.rectTransform.rect.width * GameSettings.UI_SCALE;

if (mImg != null)
{
posX = mImg.rectTransform.rect.width * GameSettings.UI_SCALE;
}
}

return new Rect(posX, Screen.height - height, width, height);
Expand Down

0 comments on commit f14e5d0

Please sign in to comment.