Skip to content

Commit f420016

Browse files
committed
ScifioImgSource: close reader only in case of exception
1 parent 3323da7 commit f420016

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

org.knime.knip.io/src/org/knime/knip/io/ScifioImgSource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ public ImgPlus<RealType> getImg(final String imgRef, final int currentSeries,
297297
m_imgOpener.openImg(getReader(imgRef), getPixelType(imgRef, currentSeries), m_imgFactory, options));
298298
org.apache.log4j.Logger.getLogger(KNIPLogService.class.getSimpleName()).setLevel(m_rootLvl);
299299
return ret;
300-
} finally {
300+
} catch(Exception e) {
301301
m_reader.closeNow();
302302
m_reader = null;
303+
throw e;
303304
}
304305

305306
}

0 commit comments

Comments
 (0)