Skip to content

Commit 810b9b0

Browse files
authored
Build fixups in master (#19338)
* Fix error with nullable * Commit yarn.lock produced from building Microsoft.InteropJS
1 parent f6c89c2 commit 810b9b0

File tree

3 files changed

+276
-366
lines changed

3 files changed

+276
-366
lines changed

src/Components/Ignitor/src/ElementHive.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,39 @@ public bool TryFindElementById(string id, [NotNullWhen(true)] out ElementNode? e
4242
foreach (var kvp in Components)
4343
{
4444
var component = kvp.Value;
45-
if (TryGetElementFromChildren(component, out element))
45+
if (TryGetElementFromChildren(component, id, out element))
4646
{
4747
return true;
4848
}
4949
}
5050

5151
element = null;
5252
return false;
53+
}
5354

54-
bool TryGetElementFromChildren(Node node, out ElementNode? foundNode)
55+
bool TryGetElementFromChildren(Node node, string id, [NotNullWhen(true)] out ElementNode? foundNode)
56+
{
57+
if (node is ElementNode elementNode &&
58+
elementNode.Attributes.TryGetValue("id", out var elementId) &&
59+
elementId.ToString() == id)
5560
{
56-
if (node is ElementNode elementNode &&
57-
elementNode.Attributes.TryGetValue("id", out var elementId) &&
58-
elementId?.ToString() == id)
59-
{
60-
foundNode = elementNode;
61-
return true;
62-
}
61+
foundNode = elementNode;
62+
return true;
63+
}
6364

64-
if (node is ContainerNode containerNode)
65+
if (node is ContainerNode containerNode)
66+
{
67+
for (var i = 0; i < containerNode.Children.Count; i++)
6568
{
66-
for (var i = 0; i < containerNode.Children.Count; i++)
69+
if (TryGetElementFromChildren(containerNode.Children[i], id, out foundNode))
6770
{
68-
if (TryGetElementFromChildren(containerNode.Children[i], out foundNode))
69-
{
70-
return true;
71-
}
71+
return true;
7272
}
7373
}
74-
75-
foundNode = null;
76-
return false;
7774
}
75+
76+
foundNode = null;
77+
return false;
7878
}
7979

8080
private void UpdateComponent(RenderBatch batch, int componentId, ArrayBuilderSegment<RenderTreeEdit> edits)

0 commit comments

Comments
 (0)