diff OrthancServer/ServerJobs/MergeStudyJob.cpp @ 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 023b2a9f3aa1
children 771dbd9eb3bd
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
      **/