more safety options for non existing materials
This commit is contained in:
@@ -129,7 +129,10 @@ void DetectorConstruction::DefineMaterials()
|
||||
nistManager->FindOrBuildMaterial("G4_AIR");
|
||||
auto cwLayers = cw->getLayers();
|
||||
for(auto layer : cwLayers){
|
||||
nistManager->FindOrBuildMaterial(layer.material);
|
||||
|
||||
auto ret = nistManager->FindOrBuildMaterial(layer.material);
|
||||
if(ret == nullptr)
|
||||
throw std::runtime_error("material not found: " + layer.material);
|
||||
}
|
||||
|
||||
// Print materials
|
||||
|
||||
Reference in New Issue
Block a user