Skip to content

Commit 6c1ff65

Browse files
committed
fix unitialized variables in an EMCAL exception
Now giving proper error log when the exception occurs
1 parent 487e3e0 commit 6c1ff65

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Detectors/EMCAL/base/include/EMCALBase/GeometryBase.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class InvalidModuleException : public std::exception
6767
class InvalidPositionException : public std::exception
6868
{
6969
public:
70-
InvalidPositionException(double eta, double phi) : std::exception()
70+
InvalidPositionException(double eta, double phi) : std::exception(), mEta(eta), mPhi(phi)
7171
{
7272
std::stringstream msgbuilder;
7373
msgbuilder << "Position phi (" << mPhi << "), eta(" << mEta << ") not im EMCAL";
@@ -81,7 +81,8 @@ class InvalidPositionException : public std::exception
8181
const char* what() const noexcept final { return mMessage.c_str(); }
8282

8383
private:
84-
double mEta, mPhi; ///< Position (eta, phi) raising the exception
84+
double mEta = 0.;
85+
double mPhi = 0.; ///< Position (eta, phi) raising the exception
8586
std::string mMessage; ///< Error message
8687
};
8788

0 commit comments

Comments
 (0)