From 1c43f604cb847d7a547ed22f12d97fe12b57a6cc Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Sun, 22 Apr 2012 20:53:16 +0200 Subject: Check typeName for nullness. --- src/exiv2wrapper.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index 8e7c3d4..f9eb579 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -559,7 +559,11 @@ ExifTag::ExifTag(const std::string& key, // which we’d rather keep the 'Comment' type instead of 'Undefined'. if ((_data != 0) && (_type != "Comment")) { - _type = _datum->typeName(); + const char* typeName = _datum->typeName(); + if (typeName != 0) + { + _type = typeName; + } } _name = exifKey.tagName(); _label = exifKey.tagLabel(); @@ -578,7 +582,11 @@ ExifTag::ExifTag(const std::string& key, // which we’d rather keep the 'Comment' type instead of 'Undefined'. if ((_data != 0) && (_type != "Comment")) { - _type = _datum->typeName(); + const char* typeName = _datum->typeName(); + if (typeName != 0) + { + _type = typeName; + } } _name = Exiv2::ExifTags::tagName(tag, ifd); _label = Exiv2::ExifTags::tagLabel(tag, ifd); -- cgit