diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-07-02 19:27:35 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-07-02 19:27:35 (GMT) |
commit | 7a1d879ca67e2890e3134f20ebf0041c54e66cb9 (patch) | |
tree | 9b69ff570b5b4b63f3103413c4dc0fe4a8a4cd2b | |
parent | d0c6b19035623a8b247f8c4eb7f72d616d4efac2 (diff) | |
download | swift-contrib-7a1d879ca67e2890e3134f20ebf0041c54e66cb9.zip swift-contrib-7a1d879ca67e2890e3134f20ebf0041c54e66cb9.tar.bz2 |
Don't crash when signing out if the debug console's open.
Resolves: #484
-rw-r--r-- | Swift/QtUI/QtChatTabs.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp index 5473823..2f4d2e5 100644 --- a/Swift/QtUI/QtChatTabs.cpp +++ b/Swift/QtUI/QtChatTabs.cpp @@ -15,6 +15,7 @@ #include <QLayout> #include <QTabBar> #include <QApplication> +#include <qdebug.h> namespace Swift { QtChatTabs::QtChatTabs() : QWidget() { @@ -148,7 +149,10 @@ void QtChatTabs::handleTabTitleUpdated(QWidget* widget) { tabs_->tabBar()->setTabTextColor(index, tabTextColor); int unread = 0; for (int i = 0; i < tabs_->count(); i++) { - unread += qobject_cast<QtTabbable*>(tabs_->widget(i))->getCount(); + QtTabbable* tab = qobject_cast<QtTabbable*>(tabs_->widget(i)); + if (tab) { + unread += tab->getCount(); + } } QtTabbable* current = qobject_cast<QtTabbable*>(tabs_->currentWidget()); |