Commit 43f4def1 authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch '1985_check_for_application_ready' into 'develop'

FIX: check that input image is not null

Closes #1985

See merge request !626
parents 4047404e f5c1b11b
Pipeline #3138 passed with stages
in 84 minutes and 46 seconds
......@@ -132,6 +132,8 @@ void InputImageListParameter::SetNthImage(std::size_t i, ImageBaseType* image)
assert(image != nullptr);
// Check input availability
if (image == nullptr)
itkExceptionMacro("Image number " << i << " is null. Please check the upstream source.");
image->UpdateOutputInformation();
// Build parameter.
......@@ -142,6 +144,12 @@ void InputImageListParameter::SetNthImage(std::size_t i, ImageBaseType* image)
/*****************************************************************************/
void InputImageListParameter::AddImage(ImageBaseType* image)
{
// Check input availability
if (image == nullptr)
itkExceptionMacro("Image is null. Please check the upstream source.");
image->UpdateOutputInformation();
AddData(image, [this](auto i) -> auto { return this->FromImage(i); });
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment