changeset 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 dc18d5804746
children 4ceb9bf7b00c
files OrthancServer/ServerToolbox.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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();