diff --git a/Framework/Algorithms/src/CorelliCrossCorrelate.cpp b/Framework/Algorithms/src/CorelliCrossCorrelate.cpp index a6e0cb33adfc00ecba56d322c2c4855662b143b7..d65a6070081eee4ce1ef8ee0175de86a6f7937ba 100644 --- a/Framework/Algorithms/src/CorelliCrossCorrelate.cpp +++ b/Framework/Algorithms/src/CorelliCrossCorrelate.cpp @@ -168,6 +168,12 @@ void CorelliCrossCorrelate::exec() { // Determine period from chopper frequency. auto motorSpeed = dynamic_cast<TimeSeriesProperty<double> *>( 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()); g_log.information() << "Frequency = " << 1e9 / period << "Hz Period = " << period << "ns\n"; diff --git a/Framework/MDAlgorithms/src/FindPeaksMD.cpp b/Framework/MDAlgorithms/src/FindPeaksMD.cpp index 1e94707a155f447cab458f8d4b2e3528fef25294..988f5b7f2976b2c95365d6eaf9fb091890856e2f 100644 --- a/Framework/MDAlgorithms/src/FindPeaksMD.cpp +++ b/Framework/MDAlgorithms/src/FindPeaksMD.cpp @@ -215,12 +215,15 @@ FindPeaksMD::createPeak(const Mantid::Kernel::V3D &Q, const double binCount) { boost::shared_ptr<DataObjects::Peak> p; if (dimType == QLAB) { // 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 p->setGoniometerMatrix(m_goniometer); } else if (dimType == QSAMPLE) { // 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