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

[iOS] Fix crash navigating in Shell and trying to get the navbar visibility #14689

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Oct 4, 2021

Description of Change

Fix crash navigating in Shell and trying to get the NavBar visibility. Here https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Platform.iOS/Renderers/ShellSectionRenderer.cs#L502 the stack could have a null element. In that case, if the ShellSection is null, do not update anything related with the NavBar.

Issues Resolved

API Changes

None

Platforms Affected

  • iOS

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

Try the NuGet package from this PR in this sample: https://github.com/Kukkimonsuta/xamarin-forms-14125

PR Checklist

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

@jfversluis jfversluis merged commit 833b1bf into 5.0.0 Oct 6, 2021
@jfversluis jfversluis deleted the fix-13510 branch October 6, 2021 14:28
@uragonda-rajesh
Copy link

Hi @jfversluis,

The issue is still reproducible on Xamarin.Forms 5.0.0.2125 and we see reports in the appcenter.
Could you please take a look?

Device info :
iphone 13,3 (iphone 12 pro)
OS 15.5

Logs:
Shell.GetNavBarIsVisible (Xamarin.Forms.BindableObject obj)
ShellSectionRenderer+NavDelegate.WillShowViewController (UIKit.UINavigationController navigationController, UIKit.UIViewController viewController, System.Boolean animated)
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName)
Application.Main (System.String[] args)

Also, it was seen for Forms >= 2196
Reference : #14122

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants