From b58d7bf2cbc310b097760e6266659f70d2fd5a0a Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sun, 30 May 2010 20:38:57 +0100
Subject: Don't crash setting a bookmark if initial response didn't have a
 payload.

Resolves: #417

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_) {
-- 
cgit v0.10.2-6-g49f6