# HG changeset patch # User Sebastien Jodogne # Date 1557819009 -7200 # Node ID 3cd94bc6673131d8eb049c3b0dd659b516381e10 # Parent b0b5852622e48ba4b907f1eefe7322e441834cb1 allow creating ParsedDicomFile with empty DICOM elements diff -r b0b5852622e4 -r 3cd94bc66731 Core/DicomParsing/ParsedDicomFile.cpp --- a/Core/DicomParsing/ParsedDicomFile.cpp Mon May 13 16:15:02 2019 +0200 +++ b/Core/DicomParsing/ParsedDicomFile.cpp Tue May 14 09:30:09 2019 +0200 @@ -771,9 +771,12 @@ std::auto_ptr element(FromDcmtkBridge::CreateElementForTag(tag)); - bool hasCodeExtensions; - Encoding encoding = DetectEncoding(hasCodeExtensions); - FromDcmtkBridge::FillElementWithString(*element, tag, utf8Value, decodeDataUriScheme, encoding); + if (!utf8Value.empty()) + { + bool hasCodeExtensions; + Encoding encoding = DetectEncoding(hasCodeExtensions); + FromDcmtkBridge::FillElementWithString(*element, tag, utf8Value, decodeDataUriScheme, encoding); + } InsertInternal(dicom, element.release()); UpdateStorageUid(tag, utf8Value, false);