diff --git a/Bonsai.Editor/Layout/LayoutHelper.cs b/Bonsai.Editor/Layout/LayoutHelper.cs index 1f205ae66..3047766f4 100644 --- a/Bonsai.Editor/Layout/LayoutHelper.cs +++ b/Bonsai.Editor/Layout/LayoutHelper.cs @@ -193,6 +193,10 @@ static IReadOnlyList GetMashupArguments(InspectBuilder builde if (visualizerMappings.Count == 0) return Array.Empty(); return visualizerMappings.Select(mapping => { + // stack overflow happens if a visualizer ends up being mapped to itself + if (mapping.Source == builder) + throw new WorkflowBuildException("Combining together visualizer mappings from the same node is not currently supported.", builder); + var nestedSources = GetMashupArguments(mapping.Source, typeVisualizerMap); var visualizerType = mapping.VisualizerType ?? typeVisualizerMap.GetTypeVisualizers(mapping.Source).FirstOrDefault(); return new VisualizerFactory(mapping.Source, visualizerType, nestedSources);