Skip to content

Commit

Permalink
CV7000: handle NullPointerException when resetting allFiles in close()
Browse files Browse the repository at this point in the history
While the reader should initialize this field as an empty ArrayList, there are
scenarios where allFiles will be null when calling close().
A use case would be a reader initialized from a memo file created with a
previous release of Bio-Formats since this field was formerly a string array
set to null by default.
  • Loading branch information
sbesson committed Sep 9, 2024
1 parent e4ffbe8 commit 9e3c38b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/formats-gpl/src/loci/formats/in/CV7000Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ public void close(boolean fileOnly) throws IOException {
reversePlaneLookup = null;
extraFiles = null;
acquiredWells.clear();
allFiles.clear();
if (allFiles != null) {
allFiles.clear();
} else {
allFiles = new ArrayList<String>();
}
}
}

Expand Down

0 comments on commit 9e3c38b

Please sign in to comment.