From 325cbc388f068125ff94acfc7b488e64a825877a Mon Sep 17 00:00:00 2001 From: Maik Nijhuis <maik.nijhuis@triopsys.nl> Date: Fri, 28 Oct 2022 10:46:06 +0000 Subject: [PATCH] AST-1084 Initialize msName directly instead of lazily --- base/DP3.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base/DP3.cc b/base/DP3.cc index 97a75c09e..e3dbefa4c 100644 --- a/base/DP3.cc +++ b/base/DP3.cc @@ -106,6 +106,7 @@ static std::shared_ptr<OutputStep> MakeOutputStep( } // A name equal to . or the last name means an update of the last MS. + assert(!currentMSName.empty()); if (outName.empty() || outName == ".") { outName = currentMSName; doUpdate = true; @@ -212,8 +213,6 @@ static std::shared_ptr<Step> makeSingleStep(const std::string& type, } else if (type == "interpolate") { step = std::make_shared<steps::Interpolate>(parset, prefix); } else if (type == "out" || type == "output" || type == "msout") { - if (msName.empty()) - msName = casacore::Path(inputStep->msName()).absoluteName(); step = MakeOutputStep(inputStep, parset, prefix, msName, inputType); } else if (type == "python" || type == "pythondppp") { step = pythondp3::PyStep::create_instance(inputStep, parset, prefix); @@ -481,7 +480,7 @@ Step::ShPtr DP3::makeStepsFromParset(const common::ParameterSet& parset, const std::string& step_names_key, InputStep& inputStep, bool terminateChain, Step::MsType initial_step_output) { - std::string msName; + std::string msName = casacore::Path(inputStep.msName()).absoluteName(); const std::vector<string> stepNames = parset.getStringVector(prefix + step_names_key); -- GitLab