Die sanely when a widget doesn't exist.

This commit is contained in:
alzeih
2010-08-14 17:37:36 +12:00
parent db16ab4cdc
commit e0de1427e9

View File

@@ -318,7 +318,8 @@ namespace OpenRA.Widgets
public T GetWidget<T>(string id) where T : Widget public T GetWidget<T>(string id) where T : Widget
{ {
return (T)GetWidget(id); var widget = GetWidget(id);
return (widget != null)? (T) widget : null;
} }
public void CloseWindow() public void CloseWindow()