You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CPACSRotor::GetNominalRotationsPerMinute() returns a boost::optional<double>&. The return value is dereferenced in several places without first checking if the boost::optional holds a value:
I suggest shadowing GetNominalRotationsPerMinute in CCPACSRotor with a wrapper function that returns a double by calling generated::CPACSRotor::GetNominalRotationsPerMinute().get_value_or(0.); This makes sure that the default value for this optional is defined only in one place in the code.
The text was updated successfully, but these errors were encountered:
CPACSRotor::GetNominalRotationsPerMinute()
returns aboost::optional<double>&
. The return value is dereferenced in several places without first checking if theboost::optional
holds a value:tigl/src/rotor/CCPACSRotor.cpp
Line 220 in ede4575
tigl/src/rotor/CCPACSRotorBladeAttachment.cpp
Line 84 in ede4575
tigl/src/rotor/CTiglAttachedRotorBlade.cpp
Line 216 in ede4575
Suggestion:
I suggest shadowing
GetNominalRotationsPerMinute
inCCPACSRotor
with a wrapper function that returns a double by callinggenerated::CPACSRotor::GetNominalRotationsPerMinute().get_value_or(0.);
This makes sure that the default value for this optional is defined only in one place in the code.The text was updated successfully, but these errors were encountered: