Skip to content

Commit

Permalink
Merge pull request #376 from ncats/fix_npe
Browse files Browse the repository at this point in the history
preventing an NPE when ChemicalUtils does not have a data file
  • Loading branch information
blueSwordfish authored Oct 23, 2024
2 parents 1745aca + 2236981 commit 9707f29
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ public class ChemicalUtils {

@PostConstruct
private void setUpSalts() {
log.warn("in setUpSalts, structureHandlingConfiguration.getSaltFilePath(): {}", structureHandlingConfiguration.getSaltFilePath());
if( structureHandlingConfiguration.getSaltFilePath() == null ) {
log.warn("ChemicalUtils - setUpSalts not initialized");
return;
}
log.trace("in setUpSalts, structureHandlingConfiguration.getSaltFilePath(): {}", structureHandlingConfiguration.getSaltFilePath());
saltData = new HashMap<>();
try {
File file = new File(structureHandlingConfiguration.getSaltFilePath());
Expand Down

0 comments on commit 9707f29

Please sign in to comment.