From 9c6784a1c0dde746f2d5c9621e2653aaed6b82c2 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 8 Feb 2015 00:26:16 +0100 Subject: [PATCH] Fix #683 Two regressions; depends on the fix for #684, too --- cockatrice/src/chatview.cpp | 7 +++++-- cockatrice/src/tab_game.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/chatview.cpp b/cockatrice/src/chatview.cpp index 0bca6bf4..2166213b 100644 --- a/cockatrice/src/chatview.cpp +++ b/cockatrice/src/chatview.cpp @@ -23,8 +23,11 @@ ChatView::ChatView(const TabSupervisor *_tabSupervisor, TabGame *_game, bool _sh userContextMenu = new UserContextMenu(tabSupervisor, this, game); connect(userContextMenu, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool))); - userName = QString::fromStdString(tabSupervisor->getUserInfo()->name()); - mention = "@" + userName.toLower(); + if(tabSupervisor->getUserInfo()) + { + userName = QString::fromStdString(tabSupervisor->getUserInfo()->name()); + mention = "@" + userName.toLower(); + } mentionFormat.setFontWeight(QFont::Bold); diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index 6baac310..6a31c578 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -246,7 +246,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) activeCard(0), gameClosed(false), replay(_replay), - currentReplayStep(0) + currentReplayStep(0), + sayEdit(0) { setAttribute(Qt::WA_DeleteOnClose); @@ -885,7 +886,8 @@ void TabGame::startGame(bool resuming) gameInfo.set_started(true); static_cast(gameView->scene())->rearrange(); gameView->show(); - sayEdit->setFocus(); + if(sayEdit) + sayEdit->setFocus(); } void TabGame::stopGame()