LuckSiege / LuckSiege/PictureSelector

java.lang.NullPointerException: Attempt to invoke virtual method 'androidx.fragment.app.FragmentManager androidx.fragment.app.FragmentActivity.getSupportFragmentManager()' on a null object reference

Open
#2,702 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
13.6k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

Current use version?

当前使用的版本是多少?
##### V3.10.5

Will this problem occur in demo?

Demo能否复现这问题?
bugly报出来的,Demo无法复现,我在issues中没有找到相关的修复答案,所以在此提交

Describe the problem or provide an error log?

描述问题或提供错误log?
"java.lang.NullPointerException: Attempt to invoke virtual method 'androidx.fragment.app.FragmentManager androidx.fragment.app.FragmentActivity.getSupportFragmentManager()' on a null object reference
	at com.luck.picture.lib.basic.PictureCommonFragment.k(PictureCommonFragment.java:1927)
	at com.luck.picture.lib.PictureSelectorPreviewFragment.c(PictureSelectorPreviewFragment.java:401)
	at com.luck.picture.lib.PictureSelectorPreviewFragment$1.onMagicalViewFinish(PictureSelectorPreviewFragment.java:365)
	at com.luck.picture.lib.magical.MagicalView$6.onAnimationEnd(MagicalView.java:353)
	at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:600)
	at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1333)
	at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1575)
	at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:307)
	at android.animation.AnimationHandler.-$$Nest$mdoAnimationFrame(Unknown Source:0)
	at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:86)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1449)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1459)
	at android.view.Choreographer.doCallbacks(Choreographer.java:1089)
	at android.view.Choreographer.doFrame(Choreographer.java:998)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1431)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:210)
	at android.os.Looper.loop(Looper.java:299)
	at android.app.ActivityThread.main(ActivityThread.java:8261)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting PictureCommonFragment.java:1927 and the callers in PictureSelectorPreviewFragment.java:365 and :401, following the stack trace through MagicalView.java:353. Determine the lifecycle path that leaves the FragmentActivity null and verify that the reported crash no longer occurs, noting that the issue provides no reproducible demo or test case.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.