(8814bcb6b) Null checks on GUIStyle fonts

This commit is contained in:
Joonas Rikkonen
2019-06-11 21:46:39 +03:00
parent 5f497543a4
commit c30f1de8f3
4 changed files with 41 additions and 33 deletions
@@ -148,7 +148,7 @@ namespace Barotrauma
//find the parent GUIListBox highest in the hierarchy
for (int i = parentHierarchy.Count - 1; i >= 0; i--)
{
if (parentHierarchy[i].GUIComponent is GUIListBox) return parentHierarchy[i]?.Parent ?? parentHierarchy[i];
if (parentHierarchy[i].GUIComponent is GUIListBox) return parentHierarchy[i];
}
//or just go with the direct parent if there are no listboxes in the hierarchy
parentHierarchy.Clear();