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

fix: null pointer exception in ClusterRenderer when continuously updating cluster item values #623

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ internal class ComposeUiClusterRenderer<T : ClusterItem>(
/* AndroidComposeView triggers LayoutNode's layout phase in the View draw phase,
so trigger a draw to an empty canvas to force that */
view.draw(fakeCanvas)
val viewParent = (view.parent as ViewGroup)
val viewParent =
view.parent as? ViewGroup ?: return Bitmap.createBitmap(20, 20, Bitmap.Config.ARGB_8888)
.let(BitmapDescriptorFactory::fromBitmap)
view.measure(
View.MeasureSpec.makeMeasureSpec(viewParent.width, View.MeasureSpec.AT_MOST),
View.MeasureSpec.makeMeasureSpec(viewParent.height, View.MeasureSpec.AT_MOST),
Expand Down