From 86a5c2e6566c6caba18a2a2506a036e67450f457 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 12 Jul 2015 00:54:42 +0000 Subject: [PATCH] Fixed possible crash in ChatLobbyDialog::init by checking return value of dynamic_cast. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8591 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 87f9f0a07..b695cc62e 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -240,7 +240,10 @@ void ChatLobbyDialog::init() // add to window - dynamic_cast(MainWindow::getPage(MainWindow::ChatLobby))->addChatPage(this) ; + ChatLobbyWidget *chatLobbyPage = dynamic_cast(MainWindow::getPage(MainWindow::ChatLobby)); + if (chatLobbyPage) { + chatLobbyPage->addChatPage(this) ; + } /** List of muted Participants */ mutedParticipants.clear() ;