Skip to content

Commit 5558353

Browse files
Copilotjsuarezruiz
andcommitted
Add explanatory comment for defensive null check in ViewDidLayoutSubviews
Co-authored-by: jsuarezruiz <[email protected]>
1 parent 98e53f1 commit 5558353

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Controls/src/Core/Platform/iOS/ControlsModalWrapper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ public override void ViewDidLayoutSubviews()
136136
{
137137
base.ViewDidLayoutSubviews();
138138

139+
// Defensive check to prevent crashes during iOS snapshot creation
140+
// when VirtualView may be disposed during app state transitions
139141
if (_modal?.VirtualView is Page)
140142
{
141143
_modal?.PlatformArrange(new Rect(0, 0, View!.Bounds.Width, View.Bounds.Height));

0 commit comments

Comments
 (0)