From ebe0add3c9478a87dab9a3e7648dd424a8a3b9cf Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Fri, 24 Apr 2015 12:45:56 +0100 Subject: [PATCH] Re #11624 Allow skipping missing run files --- .../Algorithms/src/PlotAsymmetryByLogValue.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Framework/Algorithms/src/PlotAsymmetryByLogValue.cpp b/Code/Mantid/Framework/Algorithms/src/PlotAsymmetryByLogValue.cpp index 3f9033574b4c..31fa326c3b19 100644 --- a/Code/Mantid/Framework/Algorithms/src/PlotAsymmetryByLogValue.cpp +++ b/Code/Mantid/Framework/Algorithms/src/PlotAsymmetryByLogValue.cpp @@ -198,8 +198,10 @@ void PlotAsymmetryByLogValue::exec() { // Load run, apply dead time corrections and detector grouping Workspace_sptr loadedWs = doLoad(i); - // Analyse loadedWs - doAnalysis (loadedWs, i); + if ( loadedWs ) { + // Analyse loadedWs + doAnalysis (loadedWs, i); + } } progress.report(); @@ -368,6 +370,12 @@ Workspace_sptr PlotAsymmetryByLogValue::doLoad (int64_t runNumber ) { fnn << std::setw(g_filenameZeros) << std::setfill('0') << runNumber; fn << g_filenameBase << fnn.str() << g_filenameExt; + // Check if file exists + if ( !Poco::File(fn.str()).exists() ) { + g_log.warning() << "File " << fn.str() << " not found" << std::endl; + return Workspace_sptr(); + } + // Load run IAlgorithm_sptr load = createChildAlgorithm("LoadMuonNexus"); load->setPropertyValue("Filename", fn.str());