From fa4a177cd57596e1cafe61b7efe9c4c44522e5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Jan 2016 23:09:04 +0100 Subject: [PATCH] fix a NullReferenceException when the widget is unbound --- OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs index d8fa071721..4f77a0fa70 100644 --- a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs @@ -379,6 +379,9 @@ namespace OpenRA.Mods.Common.Widgets void BindingAddImpl(object item) { + if (makeWidget == null) + return; + var widget = makeWidget(item); var scrollToBottom = autoScroll && ScrolledToBottom;