summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-30 19:38:57 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-30 19:38:57 (GMT)
commitb58d7bf2cbc310b097760e6266659f70d2fd5a0a (patch)
treea9875cabe3fe7602010e6ce8d52478c60c3450ca /Swiften/MUC/MUCBookmarkManager.cpp
parentdae7220aaa62ad12f704e05011e22a36a8c7d981 (diff)
downloadswift-contrib-b58d7bf2cbc310b097760e6266659f70d2fd5a0a.zip
swift-contrib-b58d7bf2cbc310b097760e6266659f70d2fd5a0a.tar.bz2
Don't crash setting a bookmark if initial response didn't have a payload.
Resolves: #417
Diffstat (limited to 'Swiften/MUC/MUCBookmarkManager.cpp')
-rw-r--r--Swiften/MUC/MUCBookmarkManager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Swiften/MUC/MUCBookmarkManager.cpp b/Swiften/MUC/MUCBookmarkManager.cpp
index cc1c8d6..77921e9 100644
--- a/Swiften/MUC/MUCBookmarkManager.cpp
+++ b/Swiften/MUC/MUCBookmarkManager.cpp
@@ -88,6 +88,9 @@ void MUCBookmarkManager::removeBookmark(const MUCBookmark& bookmark) {
}
void MUCBookmarkManager::flush() {
+ if (!storage) {
+ storage = boost::shared_ptr<Storage>(new Storage());
+ }
// Update the storage element
storage->clearRooms();
foreach(const MUCBookmark& bookmark, bookmarks_) {