From 37a3ff6afe96c39bbf075d05da72e5f2c684dfa4 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 20 Mar 2010 21:59:02 +0000
Subject: Fix for segfault when joining jdev tonight


diff --git a/Swiften/Avatars/AvatarManager.cpp b/Swiften/Avatars/AvatarManager.cpp
index 7abbb8b..42451af 100644
--- a/Swiften/Avatars/AvatarManager.cpp
+++ b/Swiften/Avatars/AvatarManager.cpp
@@ -53,6 +53,11 @@ void AvatarManager::handleVCardReceived(const JID& from, const String& promisedH
 		std::cerr << "Warning: " << from << ": Could not get vCard" << std::endl;
 		return;
 	}
+	if (!vCard) {
+		std::cerr << "Warning: " << from << ": null vcard payload" << std::endl;
+		//FIXME: Why could this happen?
+		return;
+	}
 	String realHash = Hexify::hexify(SHA1::getHash(vCard->getPhoto()));
 	if (promisedHash != realHash) {
 		std::cerr << "Warning: " << from << ": Got different vCard photo hash (" << promisedHash << " != " << realHash << ")" << std::endl;
-- 
cgit v0.10.2-6-g49f6