Skip to content

Commit

Permalink
ICS: Fix NPE when image name is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
dgault committed Jun 14, 2024
1 parent acc4b6d commit 30dc860
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 @@ -1478,10 +1478,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 30dc860

Please sign in to comment.