aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/QXmppUtils.cpp')
-rw-r--r--source/QXmppUtils.cpp6
1 files changed, 5 insertions, 1 deletions
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)