From 2f793dfdc411ad0a18f3e145f9c2e5eca531dc04 Mon Sep 17 00:00:00 2001
From: Catalin Badea <catalin.badea392@gmail.com>
Date: Thu, 2 Aug 2012 22:04:56 +0300
Subject: Fix tests.


diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index 68be032..745c9da 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -195,7 +195,7 @@ void MUCController::rejoin() {
 			muc_->setPassword(*password_);
 		}
 		//FIXME: check for received activity
-		if (lastActivity_ == boost::posix_time::not_a_date_time) {
+		if (lastActivity_ == boost::posix_time::not_a_date_time && historyController_) {
 			lastActivity_ = historyController_->getLastTimeStampFromMUC(selfJID_, toJID_);
 		}
 
@@ -792,6 +792,10 @@ void MUCController::logMessage(const std::string& message, const JID& fromJID, c
 }
 
 void MUCController::addRecentLogs() {
+	if (!historyController_) {
+		return;
+	}
+
 	std::vector<HistoryMessage> messages = historyController_->getMUCContext(selfJID_, toJID_, lastActivity_);
 
 	foreach (const HistoryMessage& message, messages) {
-- 
cgit v0.10.2-6-g49f6