TeamAmaze / TeamAmaze/AmazeFileManager
NPE on MainFragment: saveExternalIntent has null MainFragment
Open
Nobody has claimed this yet.
From-Email
Issue-Bug
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Issue explanation (write below this line)
Exception
- User Action: UI Error
- Request: Application crash
- Version: 3.5.3
- OS: Linux
samsung/dreamltexx/dreamlte:9/PPR1.180610.011/G950FXXU9DTF1:user/release-keys
9 - 28 - Device: dreamlte
- Model: SM-G950F
- Product: dreamltexx
Crash log
java.lang.NullPointerException: Attempt to invoke virtual method
'java.lang.String
com.amaze.filemanager.ui.fragments.MainFragment.getCurrentPath()' on a null
object reference
at
com.amaze.filemanager.ui.activities.MainActivity.saveExternalIntent(MainActivity.java:526)
at
com.amaze.filemanager.ui.activities.MainActivity.lambda$initFabToSave$3(MainActivity.java:520)
at
com.amaze.filemanager.ui.activities.MainActivity.lambda$initFabToSave$3$MainActivity(Unknown
Source:0)
at
com.amaze.filemanager.ui.activities.-$$Lambda$MainActivity$opuy2ju1IreIdmxg2yKbg-RrbIc.run(Unknown
Source:4)
at
com.amaze.filemanager.utils.Utils.lambda$showThemedSnackbar$0(Utils.java:357)
at
com.amaze.filemanager.utils.-$$Lambda$Utils$Nq4P65Npwao55dZx17kNIJZ2UpI.onClick(Unknown
Source:2)
at
com.google.android.material.snackbar.Snackbar$1.onClick(Snackbar.java:296)
at android.view.View.performClick(View.java:7352)
at android.widget.TextView.performClick(TextView.java:14230)
at android.view.View.performClickInternal(View.java:7318)
at android.view.View.access$3200(View.java:846)
at android.view.View$PerformClick.run(View.java:27800)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with MainActivity.java around saveExternalIntent at line 526 and its callback at line 520; inspect how the MainFragment reference is obtained and when it may be absent. Use the reported crash path to reproduce the save action, and consider the issue done when that action no longer crashes when MainFragment is null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100