From b175df7397b16283004e2f09d627ce7b504b6188 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 17 Mar 2020 19:29:52 +0100 Subject: [PATCH] fixed a possible crash with empty uis --- MLEM.Ui/UiControls.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MLEM.Ui/UiControls.cs b/MLEM.Ui/UiControls.cs index 21d584f..4d4a714 100644 --- a/MLEM.Ui/UiControls.cs +++ b/MLEM.Ui/UiControls.cs @@ -166,6 +166,8 @@ namespace MLEM.Ui { } public Element GetSelectedElement(RootElement root) { + if (root == null) + return null; this.selectedElements.TryGetValue(root.Name, out var element); return element; }