Skip to content

Commit

Permalink
Per #2924, need to check for non-null pointer before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
MET Tools Test Account committed Sep 12, 2024
1 parent 1563d97 commit 364ec6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/basic/vx_config/config_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,10 @@ RegridInfo parse_conf_regrid(Dictionary *dict, Dictionary *default_dict, bool er
}

// Conf: to_grid (optional) as an integer or string
const DictionaryEntry * entry = regrid_dict->lookup(conf_key_to_grid, false);
if(!entry) entry = regrid_default->lookup(conf_key_to_grid, false);
const DictionaryEntry * entry = nullptr;

if(regrid_dict) entry = regrid_dict->lookup(conf_key_to_grid, false);
if(!entry && regrid_default) entry = regrid_default->lookup(conf_key_to_grid, false);

// to_grid found
if(entry) {
Expand Down

0 comments on commit 364ec6d

Please sign in to comment.