Skip to content

Commit

Permalink
add protection for null pointer
Browse files Browse the repository at this point in the history
Co-authored-by: Andrea Perrotta <perrotta@cern.ch>
  • Loading branch information
ferencek and perrotta committed Feb 24, 2022
1 parent d951d12 commit 8ce818f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions EventFilter/SiPixelRawToDigi/src/PixelDataFormatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,14 @@ void PixelDataFormatter::interpretRawData(
}
}

GlobalPixel global = rocp->toGlobal(*local); // global pixel coordinate (in module)
(*detDigis).data.emplace_back(global.row, global.col, adc);
LogTrace("") << (*detDigis).data.back();
if (detDigis) {
GlobalPixel global = rocp->toGlobal(*local); // global pixel coordinate (in module)
(*detDigis).data.emplace_back(global.row, global.col, adc);
LogTrace("") << (*detDigis).data.back();
} else {
LogError("NullPointerException") << "@SUB=PixelDataFormatter::interpretRawData"
<< "DetSet pointer not set. This is not supposed to happen.";
}
}
}

Expand Down

0 comments on commit 8ce818f

Please sign in to comment.