From b1a142c98bb6f9cce91df9902ff3de5bbe3a34a3 Mon Sep 17 00:00:00 2001 From: Jared Duffey Date: Sat, 3 Aug 2024 12:41:20 -0400 Subject: [PATCH] BUG: Temporary fix for recursive pipeline to json (#1033) Temporary fix for recursive pipeline to json * Attempting to create json for a pipeline with a import dream3d filter that has stored pipeline json that also has an import dream3d filter to itself results in an infinite recursive loop until stack overflow Signed-off-by: Jared Duffey --- .../SimplnxCore/Filters/ReadDREAM3DFilter.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp index 3569f20786..19f449a232 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadDREAM3DFilter.cpp @@ -95,21 +95,21 @@ Result<> ReadDREAM3DFilter::executeImpl(DataStructure& dataStructure, const Argu nlohmann::json ReadDREAM3DFilter::toJson(const Arguments& args) const { auto json = IFilter::toJson(args); - auto importData = args.value(k_ImportFileData); - nx::core::HDF5::FileReader d3dReader(importData.FilePath); - if(d3dReader.isValid()) - { - std::string fileVersion = DREAM3D::GetFileVersion(d3dReader); - // File version checking should be more robust - if(fileVersion == DREAM3D::k_CurrentFileVersion) - { - Result pipelineResult = DREAM3D::ImportPipelineFromFile(d3dReader); - if(pipelineResult.valid()) - { - json[k_ImportedPipeline] = pipelineResult.value().toJson(); - } - } - } + // auto importData = args.value(k_ImportFileData); + // nx::core::HDF5::FileReader d3dReader(importData.FilePath); + // if(d3dReader.isValid()) + //{ + // std::string fileVersion = DREAM3D::GetFileVersion(d3dReader); + // // File version checking should be more robust + // if(fileVersion == DREAM3D::k_CurrentFileVersion) + // { + // Result pipelineResult = DREAM3D::ImportPipelineFromFile(d3dReader); + // if(pipelineResult.valid()) + // { + // json[k_ImportedPipeline] = pipelineResult.value().toJson(); + // } + // } + // } return json; }