Skip to content

Commit

Permalink
Merge pull request #4197 from dgault/ics-null-imagename
Browse files Browse the repository at this point in the history
ICS: Fix NPE when image name is empty
  • Loading branch information
melissalinkert authored Jun 18, 2024
2 parents a1d05e4 + 30dc860 commit 7ca9980
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/formats-bsd/src/loci/formats/in/ICSReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1479,10 +1479,12 @@ else if (labels.equalsIgnoreCase("x y t")) {
MetadataTools.populatePixels(store, this, true);

// populate Image data
imageName = imageName.replace('/', File.separatorChar);
imageName = imageName.replace('\\', File.separatorChar);
imageName = imageName.substring(imageName.lastIndexOf(File.separator) + 1);
store.setImageName(imageName, 0);
if (imageName != null) {
imageName = imageName.replace('/', File.separatorChar);
imageName = imageName.replace('\\', File.separatorChar);
imageName = imageName.substring(imageName.lastIndexOf(File.separator) + 1);
store.setImageName(imageName, 0);
}

if (date != null) store.setImageAcquisitionDate(new Timestamp(date), 0);

Expand Down

0 comments on commit 7ca9980

Please sign in to comment.