diff options
| author | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2009-09-12 10:48:11 +0000 |
|---|---|---|
| committer | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2009-09-12 10:48:11 +0000 |
| commit | 0503554c81a53ca618ec13715a7b37f1c148421a (patch) | |
| tree | 344cf8b8432c136471a0401e58949d443ed346ed /source/QXmppUtils.cpp | |
| parent | 8d5688abf2c695f384ef5acf6fa2eeecf1b702c1 (diff) | |
| download | qxmpp-0503554c81a53ca618ec13715a7b37f1c148421a.tar.gz | |
image hash should be null for empty image
Diffstat (limited to 'source/QXmppUtils.cpp')
| -rw-r--r-- | source/QXmppUtils.cpp | 6 |
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)
|
