We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6bb7c2 commit 1ba845eCopy full SHA for 1ba845e
1 file changed
src/celeritas/ext/detail/GeantSurfacePhysicsHelper.hh
@@ -72,9 +72,13 @@ GeantSurfacePhysicsHelper::GeantSurfacePhysicsHelper(SurfaceId sid) : sid_(sid)
72
auto* g4surf_prop = g4log_surf->GetSurfaceProperty();
73
CELER_ASSERT(g4surf_prop);
74
surface_ = dynamic_cast<G4OpticalSurface*>(g4surf_prop);
75
- CELER_ASSERT(surface_);
76
- get_property_ = GeantMaterialPropertyGetter{
77
- surface_->GetMaterialPropertiesTable(), surface_->GetName()};
+ if (surface_)
+ {
+ // The surface may not be an optical surface, or it might have no
78
+ // properties
79
+ get_property_ = GeantMaterialPropertyGetter{
80
+ surface_->GetMaterialPropertiesTable(), surface_->GetName()};
81
+ }
82
}
83
84
//---------------------------------------------------------------------------//
0 commit comments