Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
2950:dc18d5804746 | 2951:65b20d922e10 |
---|---|
76 | 76 |
77 void SimplifyTags(Json::Value& target, | 77 void SimplifyTags(Json::Value& target, |
78 const Json::Value& source, | 78 const Json::Value& source, |
79 DicomToJsonFormat format) | 79 DicomToJsonFormat format) |
80 { | 80 { |
81 assert(source.isObject()); | 81 if (!source.isObject()) |
82 { | |
83 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); | |
84 } | |
82 | 85 |
83 target = Json::objectValue; | 86 target = Json::objectValue; |
84 Json::Value::Members members = source.getMemberNames(); | 87 Json::Value::Members members = source.getMemberNames(); |
85 | 88 |
86 for (size_t i = 0; i < members.size(); i++) | 89 for (size_t i = 0; i < members.size(); i++) |