question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException on a BlurView previously shown

See original GitHub issue

I’m having trouble hiding and showing a BlurView, I have a grid with a few tiles, when a button is pressed the blur appears and then the user can hide it. When I show it for the first time or multiple times on the same tile it works properly but when I show it on another tile and go back to the first one I get an exception. The BlurView is inside a RelativeLayout and I’m using alpha + visibility to show/hide the layout (but it also happens if the Blur is outside this layout).

My code is:

final float radius = 8;
final View rootView = itemView.getRootView();

overlay.setupWith(rootView)
       .blurAlgorithm(new RenderScriptBlur(itemView.getContext(), true))
       .blurRadius(radius);
overlay.stopAutoBlurUpdate();

This is the exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getLeft()' on a null object reference
at eightbitlab.com.blurview.DefaultBlurController.setupInternalCanvasMatrix(DefaultBlurController.java:181)
at eightbitlab.com.blurview.DefaultBlurController.drawBlurredContent(DefaultBlurController.java:212)
at eightbitlab.com.blurview.BlurView.draw(BlurView.java:57)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.support.v7.widget.RecyclerView.drawChild(RecyclerView.java:4134)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:3543)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1131)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1377)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.updateDisplayListIfDirty(View.java:15185)
at android.view.View.draw(View.java:15964)
at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
at android.view.View.draw(View.java:16197)
at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690)
at android.view.View.updateDisplayListIfDirty(View.java:15190)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Dimeziscommented, Jun 30, 2016

Please check 1.1.0 version, I believe it should be fixed now.

0reactions
ricardomellocommented, Jun 30, 2016

It was fixed indeed, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

android Null pointer exception when trying to blur a bitmap
It probably finds backdrop . The problem is here Bitmap b = BitmapFactory.decodeResource(getResources(), R.id.backdrop);.
Read more >
Android crash · Issue #405 · Kureev/react-native-blur - GitHub
We see a fair number of these show up in our bug reporting system: java.lang.NullPointerException Objects.java:220java.util.Objects.
Read more >
Solved The following line of code throws a | Chegg.com
O four O five. The following line of code throws a NullPointerException: String s = person.friends[. Show transcribed image text ... answer image...
Read more >
NullPointerException (Beginning Java forum at Coderanch)
Java.lang.NullPointerException. Guys i was working with multidimensional array and when i try to execute this following program i get this error.
Read more >
ImageJ Release Notes - NIH
Thanks to Michael Schmid, fixed a bug that caused "Synchronize Windows" to throw a NullPointerException when using the "Close All" command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found