summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2016-04-06 17:23:12 +0200
committerChristian Mollekopf <mollekopf@kolabsys.com>2016-04-06 17:23:12 +0200
commit3515557707a84cbcc2d9d2a8971449c635db7ada (patch)
tree66606562fc145b1d4ae78acb1b948c4d76261476
parent51aadb19fbb70011a62a289654f2d52caa0f6acc (diff)
downloadlibkolab-3515557707a84cbcc2d9d2a8971449c635db7ada.tar.gz
Handle a crash if the xml part is empty.
-rw-r--r--kolabformat/kolabobject.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/kolabformat/kolabobject.cpp b/kolabformat/kolabobject.cpp
index db2aee1..96f3309 100644
--- a/kolabformat/kolabobject.cpp
+++ b/kolabformat/kolabobject.cpp
@@ -328,7 +328,11 @@ ObjectType KolabObjectReader::Private::readKolabV2(const KMime::Message::Ptr &ms
return InvalidObject;
}
const QByteArray &xmlData = xmlContent->decodedContent();
- Q_ASSERT(!xmlData.isEmpty());
+ if (xmlData.isEmpty()) {
+ Critical() << "no xml content in part with type" << getTypeString(objectType);
+ printMessageDebugInfo(msg);
+ return InvalidObject;
+ }
QStringList attachments;
switch (objectType) {