Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[iOS] Fix NRE in ViewRenderer.LayoutSubviews #13381

Merged
merged 1 commit into from
Jan 14, 2021
Merged

[iOS] Fix NRE in ViewRenderer.LayoutSubviews #13381

merged 1 commit into from
Jan 14, 2021

Conversation

rjantz3
Copy link
Contributor

@rjantz3 rjantz3 commented Jan 12, 2021

Description of Change

Protect against Element being null and causing trouble like it did in #13136.

API Changes

Changed:

  • if(Control != null) => if(Control != null && Element != null)

Platforms Affected

  • iOS

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

I was not able to duplicate this locally but my clients could repeatedly duplicate it on certain devices. After pushing this change to them the crashes stopped.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@rjantz3 rjantz3 changed the title [iOS] Fix NRE in ViewRenderer.LayouSubviews [iOS] Fix NRE in ViewRenderer.LayoutSubviews Jan 12, 2021
@rjantz3
Copy link
Contributor Author

rjantz3 commented Jan 12, 2021

This PR fixes a crash that gave me a stacktrace of the following:

ViewRenderer`2[TView,TNativeView].LayoutSubviews ()
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] , System.IntPtr , System.IntPtr )
UIApplication.Main (System.String[] , System.String , System.String )
Application.Main (System.String[] args)

@rmarinho
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rmarinho rmarinho requested a review from hartez January 14, 2021 00:38
@rmarinho rmarinho added this to To do in vNext+1 (5.0.0) via automation Jan 14, 2021
@rmarinho rmarinho moved this from To do to In Review in vNext+1 (5.0.0) Jan 14, 2021
@PureWeen PureWeen removed the request for review from hartez January 14, 2021 17:18
@PureWeen PureWeen merged commit a6c79e8 into xamarin:5.0.0 Jan 14, 2021
vNext+1 (5.0.0) automation moved this from In Review to Done Jan 14, 2021
@samhouts samhouts added this to the 5.0.0 milestone Jan 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants