Skip to content
Snippets Groups Projects
Commit f60d476b authored by Nick Draper's avatar Nick Draper
Browse files

First pass of null pointer derefs

re #13938
parent 3a6c8e1a
No related branches found
No related tags found
No related merge requests found
...@@ -168,6 +168,12 @@ void CorelliCrossCorrelate::exec() { ...@@ -168,6 +168,12 @@ void CorelliCrossCorrelate::exec() {
// Determine period from chopper frequency. // Determine period from chopper frequency.
auto motorSpeed = dynamic_cast<TimeSeriesProperty<double> *>( auto motorSpeed = dynamic_cast<TimeSeriesProperty<double> *>(
inputWS->run().getProperty("BL9:Chop:Skf4:MotorSpeed")); inputWS->run().getProperty("BL9:Chop:Skf4:MotorSpeed"));
if (!motorSpeed)
{
throw Exception::NotFoundError(
"Could not find a log value for the motor speed",
"BL9:Chop:Skf4:MotorSpeed");
}
double period = 1e9 / static_cast<double>(motorSpeed->timeAverageValue()); double period = 1e9 / static_cast<double>(motorSpeed->timeAverageValue());
g_log.information() << "Frequency = " << 1e9 / period g_log.information() << "Frequency = " << 1e9 / period
<< "Hz Period = " << period << "ns\n"; << "Hz Period = " << period << "ns\n";
......
...@@ -215,12 +215,15 @@ FindPeaksMD::createPeak(const Mantid::Kernel::V3D &Q, const double binCount) { ...@@ -215,12 +215,15 @@ FindPeaksMD::createPeak(const Mantid::Kernel::V3D &Q, const double binCount) {
boost::shared_ptr<DataObjects::Peak> p; boost::shared_ptr<DataObjects::Peak> p;
if (dimType == QLAB) { if (dimType == QLAB) {
// Build using the Q-lab-frame constructor // Build using the Q-lab-frame constructor
p = boost::shared_ptr<DataObjects::Peak>(new Peak(inst, Q)); p = boost::make_shared<Peak>(inst, Q);
// Save gonio matrix for later // Save gonio matrix for later
p->setGoniometerMatrix(m_goniometer); p->setGoniometerMatrix(m_goniometer);
} else if (dimType == QSAMPLE) { } else if (dimType == QSAMPLE) {
// Build using the Q-sample-frame constructor // Build using the Q-sample-frame constructor
p = boost::shared_ptr<DataObjects::Peak>(new Peak(inst, Q, m_goniometer)); p = boost::make_shared<Peak>(inst, Q, m_goniometer);
} else {
throw std::invalid_argument(
"Cannot Integrate peaks unless the dimension is QLAB or QSAMPLE");
} }
try { // Look for a detector try { // Look for a detector
......
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