From 6c1ff65e6ca6225420154f3f78f298b1adce1bdd Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Wed, 21 Nov 2018 09:47:20 +0100 Subject: [PATCH] fix unitialized variables in an EMCAL exception Now giving proper error log when the exception occurs --- Detectors/EMCAL/base/include/EMCALBase/GeometryBase.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Detectors/EMCAL/base/include/EMCALBase/GeometryBase.h b/Detectors/EMCAL/base/include/EMCALBase/GeometryBase.h index d230011e9c009..8e9c6424888df 100644 --- a/Detectors/EMCAL/base/include/EMCALBase/GeometryBase.h +++ b/Detectors/EMCAL/base/include/EMCALBase/GeometryBase.h @@ -67,7 +67,7 @@ class InvalidModuleException : public std::exception class InvalidPositionException : public std::exception { public: - InvalidPositionException(double eta, double phi) : std::exception() + InvalidPositionException(double eta, double phi) : std::exception(), mEta(eta), mPhi(phi) { std::stringstream msgbuilder; msgbuilder << "Position phi (" << mPhi << "), eta(" << mEta << ") not im EMCAL"; @@ -81,7 +81,8 @@ class InvalidPositionException : public std::exception const char* what() const noexcept final { return mMessage.c_str(); } private: - double mEta, mPhi; ///< Position (eta, phi) raising the exception + double mEta = 0.; + double mPhi = 0.; ///< Position (eta, phi) raising the exception std::string mMessage; ///< Error message };