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

[Android AppCompat] Add defensive code to prevent NRE in GetNativeSize #14933

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

jfversluis
Copy link
Member

Description of Change

This PR applies the fix from #12114 to the AppCompat versions for Android as well, hopefully fixing some sporadic exceptions.

Issues Resolved

API Changes

None

Platforms Affected

  • Android

Behavioral/Visual Changes

None, hopefully no exceptions anymore!

Before/After Screenshots

Not applicable

Testing Procedure

PR Checklist

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

IVisualElementRenderer visualElementRenderer = Android.Platform.GetRenderer(view);

if (visualElementRenderer == null || visualElementRenderer.View.IsDisposed())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know when this happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, I see it in the stack traces of the mentioned issues and this code was implemented for the fast renderers but not here. So I guess it doesn't hurt :)

@jfversluis jfversluis merged commit eea2c1d into 5.0.0 Dec 1, 2021
@jfversluis jfversluis deleted the fix-10159 branch December 1, 2021 18:42
@jfversluis jfversluis added this to Issues in Progress in 5.0.0 SR8 (Planning) - Target Date Dec. 15th via automation Dec 1, 2021
@jfversluis jfversluis moved this from Issues in Progress to Done in 5.0.0 SR8 (Planning) - Target Date Dec. 15th Dec 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
2 participants