Skip to content

Commit cd22cb9

Browse files
DICOM writer: don't throw NPE if close was already called
Shouldn't affect bfconvert, but does affect ImageJ export which calls close() twice.
1 parent e818377 commit cd22cb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: components/formats-bsd/src/loci/formats/out/DicomWriter.java

+5
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,11 @@ public void close() throws IOException {
13831383
for (int res=0; res<resolutionCount; res++) {
13841384
resolution = res;
13851385
openFile(pyramid, resolution);
1386+
1387+
if (out == null) {
1388+
// already closed
1389+
continue;
1390+
}
13861391
int resolutionIndex = getIndex(pyramid, resolution);
13871392

13881393
out.seek(out.length());

0 commit comments

Comments
 (0)