# HG changeset patch # User Sebastien Jodogne # Date 1589816465 -7200 # Node ID 3661e2a72482d294bfee7c4939991f09efdf879d # Parent c205f670098e6f61cd333ac64b6f1931c765bf32 safeguard in merge/split job diff -r c205f670098e -r 3661e2a72482 OrthancServer/ServerJobs/MergeStudyJob.cpp --- 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 **/ diff -r c205f670098e -r 3661e2a72482 OrthancServer/ServerJobs/SplitStudyJob.cpp --- 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 **/