diff OrthancServer/ServerToolbox.cpp @ 2951:65b20d922e10

throw instead of assert when Dicom tags can not be simplified
author am@osimis.io
date Mon, 03 Dec 2018 10:02:25 +0100
parents 878b59270859
children bbfd95a0c429
line wrap: on
line diff
--- a/OrthancServer/ServerToolbox.cpp	Fri Nov 30 17:19:57 2018 +0100
+++ b/OrthancServer/ServerToolbox.cpp	Mon Dec 03 10:02:25 2018 +0100
@@ -78,7 +78,10 @@
                       const Json::Value& source,
                       DicomToJsonFormat format)
     {
-      assert(source.isObject());
+      if (!source.isObject())
+      {
+        throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
+      }
 
       target = Json::objectValue;
       Json::Value::Members members = source.getMemberNames();