fix crash when pressing ctrl with tramways building window active

This commit is contained in:
Pavel Stupnikov
2015-11-12 19:56:04 +03:00
parent 8c0cafbf50
commit 88eecbe03e

View File

@@ -410,7 +410,7 @@ static bool RoadToolbar_CtrlChanged(Window *w)
/* allow ctrl to switch remove mode only for these widgets */
for (uint i = WID_ROT_ROAD_X; i <= WID_ROT_FULLROAD; i++) {
if (w->IsWidgetLowered(i)) {
if (w->GetWidget<NWidgetCore>(i) && w->IsWidgetLowered(i)) {
ToggleRoadButton_Remove(w);
return true;
}