Skip to content

Commit

Permalink
Merge pull request #3 from mcneilco/bugfix/null-pointer-getNumericValue
Browse files Browse the repository at this point in the history
Added protecting clause for null stringVal to prevent null pointer
  • Loading branch information
bffrost committed Mar 30, 2017
2 parents 57171e6 + 308d3c4 commit 780b15d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ public Double getNumericValueFromMappings(Molecule mol, String dbProperty, Colle
stringVal = stringVal.replaceAll(regexMatch, "");
stringVal = stringVal.replaceAll("[^0-9.]+", "");
}
if (stringVal.length() < 1) stringVal = null;
if (stringVal != null && stringVal.length() < 1) stringVal = null;
Double value;
if (stringVal == null && mapping.getDefaultVal() != null && mapping.getDefaultVal().length() > 0) value = new Double(mapping.getDefaultVal());
else if (stringVal ==null) value = null;
Expand Down

0 comments on commit 780b15d

Please sign in to comment.