Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null reference when resuming MainActivity #1858

Closed
4 tasks done
harshad1 opened this issue Sep 26, 2022 · 3 comments · Fixed by #1839
Closed
4 tasks done

Null reference when resuming MainActivity #1858

harshad1 opened this issue Sep 26, 2022 · 3 comments · Fixed by #1839
Assignees
Milestone

Comments

@harshad1
Copy link
Collaborator

⚠️ This issue respects the following points: ⚠️

  • This is a bug. Not a question or feature request.
  • The topic is not already reported at Issues. (I've searched it).
  • Markor is up to date. See Releases for the latest version. Updates are available from F-Droid and GitHub.
  • Is the bug still present in the latest code version (git master)? Please download and try the test version of Markor, named Mordor. No worries Markor and Mordor appear as completely separate applications, you can install both side-by-side and Markor settings are not touched. In case the issue is resolved there, you don't need to create a bug report - the change will be part of the next Markor update.

Description

I get this when launching markor sometimes. I think it is because _filesystemViewerAdapter isn't being recreated correctly on restore or something.

It manifests as markor failing to launch, and the next tap starts it correctly, so this is not a critical bug imo. Just a little annoying.

FATAL EXCEPTION: main
Process: net.gsantner.markor, PID: 31747
java.lang.RuntimeException: Unable to resume activity {net.gsantner.markor/net.gsantner.markor.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.setCurrentFolder(java.io.File, boolean)' on a null object reference
	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4761)
	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4794)
	at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:54)
	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2214)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7842)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.setCurrentFolder(java.io.File, boolean)' on a null object reference
	at net.gsantner.markor.activity.MainActivity.onNewIntent(MainActivity.java:119)
	at android.app.Activity.performNewIntent(Activity.java:8067)
	at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1429)
	at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1442)
	at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:3836)
	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4744)
	... 13 more

Steps to reproduce

  1. Launch markor
  2. Let markor sit in the background for a while
  3. This happens sometimes when starting again

Information

Android version: 12
Device: Pixel 3 xl
App Version: Latest master

Source

git master branch

Format / File type

Not specific

Additional info / Log

No response

@gsantner
Copy link
Owner

Set/Restore/Cache last/current folder & title for toolbar is something that often makes issues yes. Got rework many times already^^.

Though have not got this one a single time

@harshad1
Copy link
Collaborator Author

I think it is because i use the widget as my primary entry point into markor

@gsantner
Copy link
Owner

Part of #1839 to my reading

gsantner added a commit that referenced this issue Oct 16, 2022
…vements, by @harshad1, closes #1879, closes #1858 (PR #1839)

* Don't shift on resize
* Tighter syntax highlighting logic
* Rema,e TodoTxtParser -> TodoTxtTask

Co-authored-by: Gregor Santner <gsantner@mailbox.org>
@gsantner gsantner added this to the Markor v3.0 milestone Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants