summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-10-11 21:35:54 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-10-11 21:35:54 (GMT)
commitc061f286915bdffa93d4dc722764eae1636291cc (patch)
tree11b5c28531fc3800df9c32f9fa4dffb174f9eb46 /Swift/QtUI/Roster/RosterModel.cpp
parentcbaa100229b5001f41f13912fba2125213ab3d1f (diff)
downloadswift-c061f286915bdffa93d4dc722764eae1636291cc.zip
swift-c061f286915bdffa93d4dc722764eae1636291cc.tar.bz2
Fix for segfault on exit with open MUCs, and reinstate roster sorting.
Diffstat (limited to 'Swift/QtUI/Roster/RosterModel.cpp')
-rw-r--r--Swift/QtUI/Roster/RosterModel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/RosterModel.cpp b/Swift/QtUI/Roster/RosterModel.cpp
index 8a319ea..568c1f5 100644
--- a/Swift/QtUI/Roster/RosterModel.cpp
+++ b/Swift/QtUI/Roster/RosterModel.cpp
@@ -58,7 +58,8 @@ QModelIndex RosterModel::parent(const QModelIndex& index) const {
Q_ASSERT(item);
QtTreeWidgetItem* parentItem = item->getParentItem();
- return parentItem == tree_ ? QModelIndex() : createIndex(parentItem->row(), 0, parentItem);
+ /* parentItem_ == NULL can happen during destruction.*/
+ return parentItem == tree_ || parentItem == NULL ? QModelIndex() : createIndex(parentItem->row(), 0, parentItem);
}