diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2012-04-22 20:56:21 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2012-04-22 20:56:21 +0200 |
commit | 7e7cb325f942582a43602d460dac4c8e47fdc002 (patch) | |
tree | f6b731d26f0be85bafa754315762a870c38eead6 | |
parent | b11f81e0591d101b90dfa73fdc2322106f8a2426 (diff) | |
parent | 1c43f604cb847d7a547ed22f12d97fe12b57a6cc (diff) | |
download | pyexiv2-7e7cb325f942582a43602d460dac4c8e47fdc002.tar.gz |
Check typeName for nullness.
-rw-r--r-- | src/exiv2wrapper.cpp | 12 |
1 files 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); |