Skip to content

Commit

Permalink
DICOM writer: don't throw NPE if close was already called
Browse files Browse the repository at this point in the history
Shouldn't affect bfconvert, but does affect ImageJ export which calls
close() twice.
  • Loading branch information
melissalinkert committed Jul 23, 2024
1 parent e818377 commit cd22cb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/formats-bsd/src/loci/formats/out/DicomWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,11 @@ public void close() throws IOException {
for (int res=0; res<resolutionCount; res++) {
resolution = res;
openFile(pyramid, resolution);

if (out == null) {
// already closed
continue;
}
int resolutionIndex = getIndex(pyramid, resolution);

out.seek(out.length());
Expand Down

0 comments on commit cd22cb9

Please sign in to comment.