davemorrissey / subsampling-scale-image-view

Android library (AAR). Highly configurable, easily extendable deep zoom view for displaying huge images without loss of detail. Perfect for photo galleries, maps, building plans etc.
Apache License 2.0
7.87k stars 1.2k forks source link

NullPointException Attempt to read from field "Anim.listener" on a null object reference #569

Open PeacefulGemini opened 1 year ago

PeacefulGemini commented 1 year ago

Please provide as much of the following information as possible. Please do not raise issues to ask for help developing your app.

Expected behaviour

won't crash

Actual behaviour

sometimes crash

Steps to reproduce

zoom and move image frequently, there is a chance that crash. may be add and remove animation continuously cause to error.

Fatal Exception: java.lang.NullPointerException
Attempt to read from field 'com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$OnAnimationEventListener com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$Anim.listener' on a null object reference
com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$Anim.access$2800 (SubsamplingScaleImageView.java:1898)
com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.onDraw (SubsamplingScaleImageView.java:1018)
android.view.View.draw (View.java:23017)
android.view.View.updateDisplayListIfDirty (View.java:21885)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4526)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4499)
android.view.View.updateDisplayListIfDirty (View.java:21838)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4526)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4499)
android.view.View.updateDisplayListIfDirty (View.java:21838)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4526)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4499)
android.view.View.updateDisplayListIfDirty (View.java:21838)
android.view.ViewGroup.recreateChildDisplayList (ViewGroup.java:4526)
android.view.ViewGroup.dispatchGetDisplayList (ViewGroup.java:4499)
android.view.View.updateDisplayListIfDirty (View.java:21838)

(Include your setup code, and where relevant, your layout XML)

Affected devices

Many Android devices (Specific devices, screen densities, SDK versions)

Affected images

(Attach images you have problems with)

HeHans commented 1 year ago

@davemorrissey I also have the same issue, please provider same information.