summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:09 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:09 +0300
commit4fbb944f132eb886a6f5b350e5a14a4fe380aacf (patch)
tree6df2ed96430610ee7c35a7ca4902bbdade0e8e34 /src/gui/windows/chatwindow.cpp
parent1dc012a3bb44218778568e8f80c4e9b445802195 (diff)
downloadmanaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.gz
manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.bz2
manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.xz
manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.zip
Add missing checks into gui.
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r--src/gui/windows/chatwindow.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 3f26cc4dc..f7a101a44 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -692,11 +692,11 @@ void ChatWindow::mousePressed(MouseEvent &event)
{
if (popupMenu)
{
- Tab *const tab = mChatTabs->getSelectedTab();
- if (tab)
+ ChatTab *const cTab = dynamic_cast<ChatTab*>(
+ mChatTabs->getSelectedTab());
+ if (cTab)
{
event.consume();
- ChatTab *const cTab = dynamic_cast<ChatTab*>(tab);
if (inputManager.isActionActive(InputAction::CHAT_MOD))
{
inputManager.executeChatCommand(
@@ -2163,11 +2163,14 @@ void ChatWindow::showGMTab()
void ChatWindow::joinRoom(const bool isJoin)
{
Tab *const tab = mChatTabs->getTabByIndex(0);
- std::string name;
- if (isJoin)
- name = PlayerInfo::getRoomName();
- else
- name = _("General");
- tab->setCaption(name);
+ if (tab)
+ {
+ std::string name;
+ if (isJoin)
+ name = PlayerInfo::getRoomName();
+ else
+ name = _("General");
+ tab->setCaption(name);
+ }
}
#endif