From c7767f7c402ede4e3ddf42a9c09bbd2e45f0af00 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 19 May 2026 15:14:27 -0400 Subject: [PATCH] DYN-10493: Fix crash in Getting Started guided tour (#17111) (cherry picked from commit d7bd3aaaf507008ec146964d9c4e5ce4f9b2da57) --- src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs b/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs index 9e4fde446a3..d776cb42f20 100644 --- a/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs +++ b/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs @@ -697,10 +697,13 @@ internal static void HighlightPort(Step stepInfo, StepUIAutomation uiAutomationD //Once we have the ItemsControl we get the ContentPresenter var inputViewModel = inPorts.FirstOrDefault(x => x.PortName == (string)uiAutomationData.Parameters[3]); var dependencyObject = itemsControlPort.ItemContainerGenerator.ContainerFromItem(inputViewModel); - - Grid mainGrid = dependencyObject.ChildOfType(); + // ContainerFromItem returns null when the ItemsControl hasn't generated the + // container yet (e.g. timing race during guided-tour initialization). Skip the + // highlight rather than crash — the tour can continue without it. + if (mainGrid == null) return; + if (enableFunction) { //Creates the highlight rectangle so it can be added and shown over the port