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

[BUG] Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value for updatePopupAction #167

Closed
2 tasks done
mattisssa opened this issue Dec 14, 2024 · 3 comments · Fixed by #168
Closed
2 tasks done
Assignees
Labels

Comments

@mattisssa
Copy link

mattisssa commented Dec 14, 2024

Prerequisites

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

I tried to implement the exact same structure as shown in the documentation, but the app crashed.

Code Sample

If you can, please include a code sample that we can use to debug the bug.

From framework's ViewModel:

func updatePopupHeight(_ heightCandidate: CGFloat, _ popup: AnyPopup) async {
        guard activePopupProperties.gestureTranslation == 0 else { return }

        let newHeight = await calculatePopupHeight(heightCandidate, popup)
        if newHeight != popup.height {
            await updatePopupAction(popup.updatedHeight(newHeight))
        }
    }
Name Version
Xcode Version 16.2 (16C5032a)
Operating System iOS 18.1
Device iPhone 16 Pro
@mattisssa
Copy link
Author

Ah, alright. The issue was that I registered popups twice: once under the @main structure in the App and again in the AppDelegate with the scene 🙈

Once I removed it from AppDelegate all works fine. Shall we close the issue?

@FulcrumOne
Copy link
Contributor

Hey @mattisssa,

I decided to protect the library against such situations and implemented support for this in patch 4.0.1.

Have a nice day,
Tomasz

@FulcrumOne FulcrumOne added the bug label Dec 19, 2024
@FulcrumOne FulcrumOne self-assigned this Dec 19, 2024
@FulcrumOne FulcrumOne linked a pull request Dec 19, 2024 that will close this issue
@FulcrumOne FulcrumOne moved this to In review in Popups Roadmap Dec 19, 2024
@mattisssa
Copy link
Author

Awesome, thanks!

@github-project-automation github-project-automation bot moved this from In review to Done in Popups Roadmap Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants