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

API 21/22 crash during onVisibilityChanged #297

Open
ouchadam opened this issue May 4, 2022 · 1 comment
Open

API 21/22 crash during onVisibilityChanged #297

ouchadam opened this issue May 4, 2022 · 1 comment

Comments

@ouchadam
Copy link

ouchadam commented May 4, 2022

When running konfetti-xml : 2.0.2 on API 21/22 (could also include lower version but haven't tested) the View lifecycle causes a crash.
It looks like the constructor is directly calling into onVisibilityChanged causing a NPE as the fields are not yet initialised

Caused by: java.lang.NullPointerException: 
  at nl.dionsegijn.konfetti.xml.KonfettiView.onVisibilityChanged (KonfettiView.kt:3)
  at android.view.View.dispatchVisibilityChanged (View.java:9306)
  at android.view.View.setFlags (View.java:10737)
  at android.view.View.<init> (View.java:4410)
  at android.view.View.<init> (View.java:3891)
  at android.view.View.<init> (View.java:3870)
  at nl.dionsegijn.konfetti.xml.KonfettiView.<init> (KonfettiView.kt:1)
@DanielMartinus
Copy link
Owner

Thanks for reporting the issue @ouchadam, I'll have to make some time to dive further into this issue. Feel free to clone the project and submit a PR if you already know how to solve the issue and then I'll review the code.

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

No branches or pull requests

2 participants