From dae7220aaa62ad12f704e05011e22a36a8c7d981 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sun, 30 May 2010 20:28:31 +0100
Subject: Don't crash when the vcard response contains no payload.

Resolves: #427

diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 35a26f3..d8781c8 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -420,6 +420,9 @@ void MainController::handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo>
 }
 
 void MainController::handleOwnVCardReceived(boost::shared_ptr<VCard> vCard, const boost::optional<ErrorPayload>& error) {
+	if (!vCard) {
+		return;
+	}
 	if (!error && !vCard->getPhoto().isEmpty()) {
 		vCardPhotoHash_ = Hexify::hexify(SHA1::getHash(vCard->getPhoto()));
 		if (lastSentPresence_) {
-- 
cgit v0.10.2-6-g49f6