Codechange: Use dynamic_cast instead of C-cast after FindWindowById. (#12448)

dynamic_cast was used in most places, but not all.
This commit is contained in:
Peter Nelson
2024-04-08 13:26:19 +01:00
committed by GitHub
parent 4e6d4fcf32
commit 74e09abf76
4 changed files with 6 additions and 6 deletions

View File

@@ -1017,7 +1017,7 @@ static void ShowNewsMessage(NewsIterator ni)
*/
bool HideActiveNewsMessage()
{
NewsWindow *w = (NewsWindow*)FindWindowById(WC_NEWS_WINDOW, 0);
NewsWindow *w = dynamic_cast<NewsWindow *>(FindWindowById(WC_NEWS_WINDOW, 0));
if (w == nullptr) return false;
w->Close();
return true;