Skip to content
Snippets Groups Projects
Commit 07706d89 authored by Harry Jeffery's avatar Harry Jeffery
Browse files

Refs #11355 Fix segfault when passing invalid projection

parent b155db6f
No related branches found
No related tags found
No related merge requests found
...@@ -282,7 +282,6 @@ void CutMD::exec() { ...@@ -282,7 +282,6 @@ void CutMD::exec() {
const IMDEventWorkspace_sptr inWS = getProperty("InputWorkspace"); const IMDEventWorkspace_sptr inWS = getProperty("InputWorkspace");
const size_t numDims = inWS->getNumDims(); const size_t numDims = inWS->getNumDims();
const ITableWorkspace_sptr projection = getProperty("Projection"); const ITableWorkspace_sptr projection = getProperty("Projection");
const bool haveProjection = !(*getProperty("Projection")).isDefault();
std::vector<std::vector<double>> pbins(5); std::vector<std::vector<double>> pbins(5);
pbins[0] = getProperty("P1Bin"); pbins[0] = getProperty("P1Bin");
pbins[1] = getProperty("P2Bin"); pbins[1] = getProperty("P2Bin");
...@@ -292,7 +291,7 @@ void CutMD::exec() { ...@@ -292,7 +291,7 @@ void CutMD::exec() {
const bool noPix = getProperty("NoPix"); const bool noPix = getProperty("NoPix");
// Check Projection format // Check Projection format
if (haveProjection) { if (projection) {
auto colNames = projection->getColumnNames(); auto colNames = projection->getColumnNames();
if (colNames.size() != 4 || if (colNames.size() != 4 ||
std::find(colNames.begin(), colNames.end(), "name") == colNames.end() || std::find(colNames.begin(), colNames.end(), "name") == colNames.end() ||
......
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