Skip to content

Commit

Permalink
ImarisHDF: Handle null color rather than removing it
Browse files Browse the repository at this point in the history
  • Loading branch information
dgault committed Jul 9, 2024
1 parent fd17421 commit a5d90ad
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public short[][] get16BitLookupTable() {
FormatTools.assertId(currentId, true, 1);
if (getPixelType() != FormatTools.UINT16 || !isIndexed()) return null;

if (lastChannel < 0 || lastChannel >= colors.size()) {
if (lastChannel < 0 || lastChannel >= colors.size() || colors.get(lastChannel) == null) {
return null;
}

Expand Down Expand Up @@ -408,8 +408,7 @@ protected void initFile(String id) throws FormatException, IOException {
catch (NumberFormatException e) { }
}

colors.remove(null);
if (i < colors.size()) {
if (i < colors.size() && colors.get(i) != null) {
double[] color = colors.get(i);
Color realColor = new Color(
(int) (color[0] * 255), (int) (color[1] * 255),
Expand Down

0 comments on commit a5d90ad

Please sign in to comment.