Fix unchecked dynamic_cast

This commit is contained in:
Markus Gans 2016-07-03 20:27:27 +02:00
parent b7c11c7c90
commit 11a7aad0ee
1 changed files with 11 additions and 8 deletions

View File

@ -263,14 +263,17 @@ void FMenuItem::createDialogList (FMenu* winmenu)
if ( (*iter)->isDialog() ) if ( (*iter)->isDialog() )
{ {
FDialog* win = dynamic_cast<FDialog*>(*iter); FDialog* win = dynamic_cast<FDialog*>(*iter);
FString win_title = win->getText(); if ( win )
FMenuItem* win_item = new FMenuItem (win_title, winmenu); {
win_item->addCallback FString win_title = win->getText();
( FMenuItem* win_item = new FMenuItem (win_title, winmenu);
"clicked", win_item->addCallback
_METHOD_CALLBACK (this, &FMenuItem::cb_switchToDialog), (
dynamic_cast<FWidget::data_ptr>(win) "clicked",
); _METHOD_CALLBACK (this, &FMenuItem::cb_switchToDialog),
dynamic_cast<FWidget::data_ptr>(win)
);
}
} }
} }
while ( iter != begin ); while ( iter != begin );