junixapp/XPopup

空指针问题

Opened this issue · 0 comments

XPopup版本
2.9.19 最新版本

描述你的问题
偶现闪退,线上日志分析,查看大图弹窗ImageViewerPopupView
destroy() -> pager.getAdapter()=null导致的空指针异常

报错堆栈信息
com.lxj.xpopup.core.ImageViewerPopupView.destroy (ImageViewerPopupView.java:6)
com.lxj.xpopup.core.BasePopupView.onDestroy (BasePopupView.java:7)
com.lxj.xpopup.core.BasePopupView_LifecycleAdapter.callMethods (BasePopupView_LifecycleAdapter.java:26)
androidx.lifecycle.SingleGeneratedAdapterObserver.onStateChanged (SingleGeneratedAdapterObserver.java:5)
androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent (LifecycleRegistry.java:15)
androidx.lifecycle.LifecycleRegistry.backwardPass (LifecycleRegistry.java:72)
androidx.lifecycle.LifecycleRegistry.sync (LifecycleRegistry.java:42)
androidx.lifecycle.LifecycleRegistry.moveToState (LifecycleRegistry.java:20)
androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent (LifecycleRegistry.java:10)
androidx.lifecycle.ReportFragment.dispatch (ReportFragment.java:6)
androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPreDestroyed (ReportFragment.java:3)
android.app.Activity.dispatchActivityPreDestroyed (Activity.java:1556)
android.app.Activity.performDestroy (Activity.java:8567)
android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1364)
android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5937)
android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5995)
android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:47)
android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2438)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loopOnce (Looper.java:226)
android.os.Looper.loop (Looper.java:313)
android.app.ActivityThread.main (ActivityThread.java:8669)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)