Skip to content
Snippets Groups Projects
Commit f609c590 authored by Scott Snyder's avatar Scott Snyder Committed by scott snyder
Browse files

BeamPipeGeoModel: Another attempt to fix coverity 113158.

coverity: possible null pointer dereference.

Former-commit-id: e9ee2aef
parent 67c24440
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC ...@@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC
Control/CLIDSvc Control/CLIDSvc
Control/SGTools Control/SGTools
Control/StoreGate Control/StoreGate
Control/AthenaKernel
DetectorDescription/GeoModel/GeoModelInterfaces DetectorDescription/GeoModel/GeoModelInterfaces
GaudiKernel ) GaudiKernel )
...@@ -27,7 +28,7 @@ atlas_add_library( BeamPipeGeoModelLib ...@@ -27,7 +28,7 @@ atlas_add_library( BeamPipeGeoModelLib
PUBLIC_HEADERS BeamPipeGeoModel PUBLIC_HEADERS BeamPipeGeoModel
INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} GeoModelKernel GeoModelUtilities StoreGateLib SGtests LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} GeoModelKernel GeoModelUtilities StoreGateLib SGtests
PRIVATE_LINK_LIBRARIES SGTools GaudiKernel ) PRIVATE_LINK_LIBRARIES SGTools AthenaKernel GaudiKernel )
atlas_add_component( BeamPipeGeoModel atlas_add_component( BeamPipeGeoModel
src/components/*.cxx src/components/*.cxx
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
#include "RDBAccessSvc/IRDBRecordset.h" #include "RDBAccessSvc/IRDBRecordset.h"
#include "RDBAccessSvc/IRDBAccessSvc.h" #include "RDBAccessSvc/IRDBAccessSvc.h"
#include "AthenaKernel/getMessageSvc.h"
#include "GaudiKernel/MsgStream.h"
#include <iomanip> #include <iomanip>
#include <vector> #include <vector>
...@@ -240,9 +243,15 @@ void BeamPipeDetectorFactory::addSections(GeoPhysVol* parent, int region) ...@@ -240,9 +243,15 @@ void BeamPipeDetectorFactory::addSections(GeoPhysVol* parent, int region)
GeoNameTag* ntSection = new GeoNameTag(name); GeoNameTag* ntSection = new GeoNameTag(name);
if (addToFirstSection && secNum!=1) { if (addToFirstSection && secNum!=1) {
//std::cout << "Placing section " << secNum << " in Section1" << std::endl; if (!pvMotherSection) {
pvMotherSection->add(ntSection); MsgStream gLog(Athena::getMessageSvc(), "BeamPipeDetectorFactory");
pvMotherSection->add(pvSection); gLog << MSG::ERROR << "Logic error building beam pipe." << endmsg;
}
else {
//std::cout << "Placing section " << secNum << " in Section1" << std::endl;
pvMotherSection->add(ntSection);
pvMotherSection->add(pvSection);
}
} else { } else {
//std::cout << "Placing section " << secNum << " in mother envelope" << std::endl; //std::cout << "Placing section " << secNum << " in mother envelope" << std::endl;
parent->add(ntSection); parent->add(ntSection);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment