File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,9 +133,10 @@ IPLCommonImageIO::ReadImageInformation()
133133 FileNameToRead = _imagePath;
134134
135135 this ->m_ImageHeader = this ->ReadHeader (FileNameToRead.c_str ());
136- //
137- // if anything fails in the header read, just let
138- // exceptions propagate up.
136+ if (m_ImageHeader == nullptr )
137+ {
138+ itkExceptionMacro (" ReadHeader failed for " << FileNameToRead);
139+ }
139140
140141 bool isCT = false ;
141142 std::string modality = m_ImageHeader->modality ;
@@ -224,6 +225,10 @@ IPLCommonImageIO::ReadImageInformation()
224225 // throw an exception, and we'd just want to skip it.
225226 continue ;
226227 }
228+ if (curImageHeader == nullptr )
229+ {
230+ itkExceptionMacro (" ReadHeader failed for " << fullPath);
231+ }
227232 if ((((isCT) ? curImageHeader->examNumber : curImageHeader->echoNumber ) == m_FilenameList->GetKey2 ()) &&
228233 (curImageHeader->seriesNumber == m_FilenameList->GetKey1 ()))
229234 {
You can’t perform that action at this time.
0 commit comments