Skip to content

Commit

Permalink
MincReader: Further null pointer checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dgault committed Mar 3, 2022
1 parent 8300685 commit a63ef29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/formats-gpl/src/loci/formats/in/MINCReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@ protected void initFile(String id) throws FormatException, IOException {
boolean signed = false;
if (isMINC2) {
Hashtable<String, Object> attrs = netcdf.getVariableAttributes("/minc-2.0/image/0/image");
String unsigned = attrs.get("_Unsigned").toString();
if (unsigned != null && !unsigned.startsWith("true")) {
signed = true;
if (attrs.get("_Unsigned") != null) {
String unsigned = attrs.get("_Unsigned").toString();
if (!unsigned.startsWith("true")) {
signed = true;
}
}
}
else {
Expand Down

0 comments on commit a63ef29

Please sign in to comment.