diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index 0d1f6f1a971b8cede8cc112d30d24e42a9cf92c0..fb2a7db084319118bcdb89e0baaffb61b8ce2198 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -2160,7 +2160,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
 					sess.terminate()
 					del self.sessions[jid_stripped][sess.thread_id]
 
-		if avatar_sha and ptype != 'error':
+		if avatar_sha is not None and ptype != 'error':
 			if not self.vcard_shas.has_key(jid_stripped):
 				cached_vcard = self.get_cached_vcard(jid_stripped)
 				if cached_vcard and cached_vcard.has_key('PHOTO') and \