summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/Storages/VCardFileStorage.cpp')
-rw-r--r--Swift/Controllers/Storages/VCardFileStorage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/Controllers/Storages/VCardFileStorage.cpp b/Swift/Controllers/Storages/VCardFileStorage.cpp
index b101ecf..b22e235 100644
--- a/Swift/Controllers/Storages/VCardFileStorage.cpp
+++ b/Swift/Controllers/Storages/VCardFileStorage.cpp
@@ -82,19 +82,19 @@ std::string VCardFileStorage::getPhotoHash(const JID& jid) const {
}
else {
VCard::ref vCard = getVCard(jid);
return getAndUpdatePhotoHash(jid, vCard);
}
}
std::string VCardFileStorage::getAndUpdatePhotoHash(const JID& jid, VCard::ref vCard) const {
std::string hash;
- if (vCard) {
+ if (vCard && !vCard->getPhoto().empty()) {
hash = Hexify::hexify(crypto->getSHA1Hash(vCard->getPhoto()));
}
std::pair<PhotoHashMap::iterator, bool> r = photoHashes.insert(std::make_pair(jid, hash));
if (r.second) {
savePhotoHashes();
}
else if (r.first->second != hash) {
r.first->second = hash;
savePhotoHashes();