Skip to content
Snippets Groups Projects
Commit fcd68516 authored by Joseph Boudreau's avatar Joseph Boudreau
Browse files

Bugfix: volumes disconnect when they are written out.

parent 2c890f12
No related branches found
No related tags found
No related merge requests found
Pipeline #1601137 passed
......@@ -825,8 +825,12 @@ void WriteGeoModel::handleReferencedVPhysVol (const GeoVPhysVol *vol)
m_unconnectedTree = false;
// get the parent volume, if this is not the Root volume
const GeoVPhysVol* parentNode = dynamic_cast<const GeoVPhysVol*>( &(*(vol->getParent() )));
// JFB The following construct does not work: what if the parent is null?
// const GeoVPhysVol* parentNode = dynamic_cast<const GeoVPhysVol*>( &(*(vol->getParent() )));
/// JFB So I replaced it by the next two lines:
auto p=vol->getParent();
const GeoVPhysVol* parentNode = p ? dynamic_cast<const GeoVPhysVol*>( &(*(vol->getParent() ))) : nullptr;
if (parentNode) {
QString parentAddress = getAddressStringFromPointer(parentNode);
//JFB Commented out: qDebug() << "--> parent's address:" << parentNode;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment