Skip to content

Commit c0decf7

Browse files
chris-allanmelissalinkert
authored andcommitted
Fix null pointer exception on close()
It is possible that classes will be rehydrated from memo files where `allFiles` was not present and thus will be initialized as `null`. If this is the case, `close()` will throw null pointer exceptions when called. This may happen even for cases where the VectraReader is never used. Mitigation for scenarios where this bug is present are to remove all memo files on the system and regenerate them.
1 parent b885f50 commit c0decf7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/formats-gpl/src/loci/formats/in/VectraReader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ public void close(boolean fileOnly) throws IOException {
176176
if (!fileOnly) {
177177
pyramidDepth = 1;
178178
profileXML = null;
179-
allFiles.clear();
179+
if (allFiles != null) {
180+
allFiles.clear();
181+
}
180182
}
181183
}
182184

0 commit comments

Comments
 (0)