mirror of https://github.com/OpenTTD/OpenTTD.git
Orders window has different widget layouts depending on vehicle type which don't all have the same widgets, and therefore it tries to disable widgets that might not exist. Restore the old behaviour of ignoring such requests, instead of crashing.
This commit is contained in:
parent
268e512fb8
commit
f3b4d2a384
|
@ -327,7 +327,8 @@ public:
|
|||
*/
|
||||
inline void SetWidgetDisabledState(WidgetID widget_index, bool disab_stat)
|
||||
{
|
||||
this->GetWidget<NWidgetCore>(widget_index)->SetDisabled(disab_stat);
|
||||
NWidgetCore *nwid = this->GetWidget<NWidgetCore>(widget_index);
|
||||
if (nwid != nullptr) nwid->SetDisabled(disab_stat);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue