Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForDefaultWindow() can return null #103

Closed
Cheesebaron opened this issue Sep 11, 2023 · 0 comments · Fixed by #104
Closed

ForDefaultWindow() can return null #103

Cheesebaron opened this issue Sep 11, 2023 · 0 comments · Fixed by #104

Comments

@Cheesebaron
Copy link
Collaborator

Cheesebaron commented Sep 11, 2023

🐛 Bug Report

I'm seeing a bunch of crashes in AppCenter with trace:

SIGABRT: Arg_NullReferenceException

    BigTed.ProgressHUD.For(UIWindow window)
    BigTed.ProgressHUD.ForDefaultWindow()
    BigTed.BTProgressHUD.Dismiss()
    TrackMan.DrivingRangeApp.iOS.Services.ProgressHudService.<>c__DisplayClass8_0.<<Dismiss>b__0>d.MoveNext()
    ObjCRuntime.Runtime.ThrowException(IntPtr )
    UIKit.UIApplication.UIApplicationMain(Int32 , String[] , IntPtr , IntPtr )
    UIKit.UIApplication.Main(String[] , Type , Type )
    Program.<Main>$(String[] args)

Looks like ForDefaultWindow() has a null forgiving ! on the window instance passed to the For() method, which makes it crash if it is actually null as For() doesn't expect it to be null.

❓ Expected behavior

No crashes please.

🪜 Reproduction steps

🤷‍♂️

🛠 Configuration

📦 Package Version: 2.0.0

📱 iOS Version: Mainly iOS 16

Cheesebaron added a commit that referenced this issue Sep 13, 2023
Fix null Window in `For` and `ForDefaultWindow`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant