From 0503554c81a53ca618ec13715a7b37f1c148421a Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Sat, 12 Sep 2009 10:48:11 +0000 Subject: image hash should be null for empty image --- source/QXmppUtils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/QXmppUtils.cpp') diff --git a/source/QXmppUtils.cpp b/source/QXmppUtils.cpp index 0b16da03..b34f9902 100644 --- a/source/QXmppUtils.cpp +++ b/source/QXmppUtils.cpp @@ -124,7 +124,11 @@ QString getImageType(const QByteArray& image) QString getImageHash(const QByteArray& image) { - return QString(QCryptographicHash::hash(image, QCryptographicHash::Sha1).toHex()); + if(image.isEmpty()) + return ""; + else + return QString(QCryptographicHash::hash(image, + QCryptographicHash::Sha1).toHex()); } QImage getImageFromByteArray(const QByteArray& image) -- cgit v1.2.3