Codefix: check the result of dynamic_cast for nullptr

This commit is contained in:
Rubidium
2025-03-09 18:05:53 +01:00
committed by rubidium42
parent d07d75229b
commit 0de7fd3c24
4 changed files with 6 additions and 1 deletions
+1
View File
@@ -1925,6 +1925,7 @@ static void NewGRFConfirmationCallback(Window *w, bool confirmed)
CloseWindowByClass(WC_GRF_PARAMETERS);
CloseWindowByClass(WC_TEXTFILE);
NewGRFWindow *nw = dynamic_cast<NewGRFWindow*>(w);
assert(nw != nullptr);
_gamelog.StartAction(GLAT_GRF);
_gamelog.GRFUpdate(_grfconfig, nw->actives); // log GRF changes