Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Grid>();

// 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
Expand Down
Loading