Dear Geant4 developers, I have a G4 application in which I make a logical volume via a call like myLVptr = new G4LogicalVolume(aSolid, G4Material::GetMaterial(matName), lvName); Unfortunately, the string matName was not an existing G4Material, so G4Material::GetMaterial(matName) quietly returned NULL. The G4LogicalVolume was happy accepting this without any errors or warnings, but it eventually made my program (silently) crash during G4RunManager::RunInitialization() when updating the G4ProductionCutsTable. I would like to suggest the following: - Make G4LogicalVolume::SetMaterial(G4Material *pMaterial) check that pMaterial is not NULL, and emit an error if it is. No logical volume should have a NULL material pointer, right? - Make G4Material::GetMaterial(G4String materialName) emit a warning message if materialName is not the name of an existing material. Thanks, Jason
done for what concern G4Material
NULL pointer to material must be allowed by G4LogicalVolume for the use-case of readout and ghost (envelopes) geometries. The problem anyhow exists since NULL material pointers should not be allowed for the 'tracking' geometry. A fix has been introduced in G4Region and is included in the development tag "geommng-V07-00-01". It will be included in future releases. Thanks.