summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-30 19:28:31 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-30 19:28:31 (GMT)
commitdae7220aaa62ad12f704e05011e22a36a8c7d981 (patch)
tree26aa3c46b7a7b02c0ad32e7f1d48c97181a3077e /Swift
parentc3795a7260404ecf450b1720dd655199e3b18243 (diff)
downloadswift-contrib-dae7220aaa62ad12f704e05011e22a36a8c7d981.zip
swift-contrib-dae7220aaa62ad12f704e05011e22a36a8c7d981.tar.bz2
Don't crash when the vcard response contains no payload.
Resolves: #427
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp3
1 files changed, 3 insertions, 0 deletions
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_) {