changeset 3940:3661e2a72482 transcoding

safeguard in merge/split job
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 18 May 2020 17:41:05 +0200
parents c205f670098e
children 771dbd9eb3bd
files OrthancServer/ServerJobs/MergeStudyJob.cpp OrthancServer/ServerJobs/SplitStudyJob.cpp
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/ServerJobs/MergeStudyJob.cpp	Mon May 18 17:15:16 2020 +0200
+++ b/OrthancServer/ServerJobs/MergeStudyJob.cpp	Mon May 18 17:41:05 2020 +0200
@@ -81,6 +81,12 @@
 
   bool MergeStudyJob::HandleInstance(const std::string& instance)
   {
+    if (!HasTrailingStep())
+    {
+      throw OrthancException(ErrorCode_BadSequenceOfCalls,
+                             "AddTrailingStep() should have been called after AddSourceXXX()");
+    }
+    
     /**
      * Retrieve the DICOM instance to be modified
      **/
--- a/OrthancServer/ServerJobs/SplitStudyJob.cpp	Mon May 18 17:15:16 2020 +0200
+++ b/OrthancServer/ServerJobs/SplitStudyJob.cpp	Mon May 18 17:41:05 2020 +0200
@@ -67,6 +67,12 @@
   
   bool SplitStudyJob::HandleInstance(const std::string& instance)
   {
+    if (!HasTrailingStep())
+    {
+      throw OrthancException(ErrorCode_BadSequenceOfCalls,
+                             "AddTrailingStep() should have been called after AddSourceSeries()");
+    }
+    
     /**
      * Retrieve the DICOM instance to be modified
      **/