diff OrthancServer/FromDcmtkBridge.cpp @ 1429:7366a0bdda6a

attempt of fix for Syngo.Via
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 Jun 2015 14:43:08 +0200
parents 8e23f16a198d
children f967bdf8534e
line wrap: on
line diff
--- a/OrthancServer/FromDcmtkBridge.cpp	Mon Jun 29 13:26:34 2015 +0200
+++ b/OrthancServer/FromDcmtkBridge.cpp	Mon Jun 29 14:43:08 2015 +0200
@@ -221,12 +221,18 @@
     if (element.isaString())
     {
       char *c;
-      if (element.getString(c).good() &&
-          c != NULL)
+      if (element.getString(c).good())
       {
-        std::string s(c);
-        std::string utf8 = Toolbox::ConvertToUtf8(s, encoding);
-        return new DicomString(utf8);
+        if (c == NULL)  // This case corresponds to the empty string
+        {
+          return new DicomString("");
+        }
+        else
+        {
+          std::string s(c);
+          std::string utf8 = Toolbox::ConvertToUtf8(s, encoding);
+          return new DicomString(utf8);
+        }
       }
       else
       {