Skip to content

Commit

Permalink
fix coverity 1223399,1223400 (dynamic_cast checks), re #11328
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Mar 12, 2015
1 parent 78c44fe commit 27d2136
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp
Expand Up @@ -305,12 +305,21 @@ void LoadILLReflectometry::loadDataIntoTheWorkSpace(
// 1) Get some parameters from nexus file and properties
// Note : This should be changed following future D17/ILL nexus file
// improvement.
const std::string propTOF0 = "monitor1.time_of_flight_0";
auto tof_channel_width_prop = dynamic_cast<PropertyWithValue<double> *>(
m_localWorkspace->run().getProperty("monitor1.time_of_flight_0"));
m_localWorkspace->run().getProperty(propTOF0));
if (!tof_channel_width_prop)
throw std::runtime_error("Could not cast (interpret) the property " +
propTOF0 + " (channel width) as a floating point "
"value.");
m_channelWidth = *tof_channel_width_prop; /* PAR1[95] */

const std::string propTOF2 = "monitor1.time_of_flight_2";
auto tof_delay_prop = dynamic_cast<PropertyWithValue<double> *>(
m_localWorkspace->run().getProperty("monitor1.time_of_flight_2"));
m_localWorkspace->run().getProperty(propTOF2));
if (!tof_delay_prop)
throw std::runtime_error("Could not cast (interpret) the property " +
propTOF2 + " (ToF delay) as a floating point value.");
double tof_delay = *tof_delay_prop; /* PAR1[96] */

double POFF = entry.getFloat("instrument/VirtualChopper/poff"); /* par1[54] */
Expand Down

0 comments on commit 27d2136

Please sign in to comment.