Skip to content

Commit 9a5e663

Browse files
authored
Fix: Check FrameType before accessing ComponentId in tests (#64147)
Two tests accessed ComponentId without validating FrameType == Component, violating the API contract (RenderTreeFrame.cs:161-165). This causes regressions on big-endian architectures (s390x).
1 parent 5dde6e4 commit 9a5e663

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Components/Components/test/RendererTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,7 @@ public void RenderBatchIncludesListOfDisposedComponents()
22432243
.Where(frame => frame.FrameType == RenderTreeFrameType.Component)
22442244
.Select(frame => frame.ComponentId)
22452245
.ToList();
2246-
var childComponent3 = batch.ReferenceFrames.Where(f => f.ComponentId == 3)
2246+
var childComponent3 = batch.ReferenceFrames.Where(f => f.FrameType == RenderTreeFrameType.Component && f.ComponentId == 3)
22472247
.Single().Component;
22482248
Assert.Equal(new[] { 1, 2 }, childComponentIds);
22492249
Assert.IsType<FakeComponent>(childComponent3);
@@ -3050,7 +3050,7 @@ public void QueuedRenderIsSkippedIfComponentWasAlreadyDisposedInSameBatch()
30503050
component.TriggerRender();
30513051
var childComponentId = renderer.Batches.Single()
30523052
.ReferenceFrames
3053-
.Where(f => f.ComponentId != 0)
3053+
.Where(f => f.FrameType == RenderTreeFrameType.Component && f.ComponentId != 0)
30543054
.Single()
30553055
.ComponentId;
30563056
var origEventHandlerId = renderer.Batches.Single()

0 commit comments

Comments
 (0)