Skip to content

Commit

Permalink
#2028 Check if the pointer (d) is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Feb 1, 2022
1 parent c767e8f commit 310c236
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions met/src/tools/other/mode_time_domain/mtd_file_int.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1206,19 +1206,19 @@ if ( Nobjects == 0 ) return;

old.ObjVolume = new int [Nobjects];

d = old.Data;

for (j=0; j<Nobjects; ++j) old.ObjVolume[j] = 0;

d = old.Data;
if (d) {
for (j=0; j<Nxyt; ++j, ++d) {

for (j=0; j<Nxyt; ++j, ++d) {

k = (int) (*d);
k = (int) (*d);

if ( k == 0 ) continue;
if ( k == 0 ) continue;

old.ObjVolume[k - 1] += 1;
old.ObjVolume[k - 1] += 1;

}
}


Expand Down

0 comments on commit 310c236

Please sign in to comment.