nextcloud / nextcloud/notes-android

Main notes view accessible after signing out / App crash: `NullPointerException` at `getDisplayName()` via `AccountSwitcherDialog`

Open
#1,580 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
1.1k
Forks
168
Avg merge
1d 17h
Merged PRs (30d)
31

Description

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug
After signing out (profile picture -> „Manage accounts“ -> gear icon -> „Remove“) you can navigate back from the login view using the Android gesture to the Notes list view. The notes are gone but if you click on the profile picture again, the app throws an exception.

To Reproduce

  1. Be signed in to a Nextcloud Account
  2. Click on your profile picture in the upper-right corner
  3. Click on „Manage accounts“
  4. Click on the gear icon on the right next to the account
  5. Click „Remove“
  6. Navigate back using the back android gesture (either the button or the swipe gesture on one of the sides)
  7. Click on the profile picture again

Expected behavior
Login view should be an initial view from which you cannot navigate back

Screenshots

N/A

Smartphone (please complete the following information):

  • Nextcloud Notes-Version (android app): v3.6.0
  • F-Droid or Play Store: F-Droid
  • Android-Version: Android 12 (PixelExperience ROM)
  • Device: OnePlus 7 (GM1903)

Server

  • Nextcloud version: v24.0.5.1 (Nextcloud AIO docker image)
  • Nextcloud Notes version (server app): v4.5.1

Stacktrace

App Version: 3.6.0
App Version Code: 3006000
App Flavor: fdroid

Files App Version Code: 30210290

---

OS Version: 4.14.290-ACK-CLO-Hybrid(1660307794)
OS API Level: 32
Device: OnePlus7
Manufacturer: OnePlus
Model (and Product): GM1903 (OnePlus7)

---

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String it.niedermann.owncloud.notes.persistence.entity.Account.getDisplayName()' on a null object reference
	at it.niedermann.owncloud.notes.accountswitcher.AccountSwitcherDialog.lambda$onCreateDialog$3$it-niedermann-owncloud-notes-accountswitcher-AccountSwitcherDialog(AccountSwitcherDialog.java:70)
	at it.niedermann.owncloud.notes.accountswitcher.AccountSwitcherDialog$$ExternalSyntheticLambda4.onChanged(Unknown Source:6)
	at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
	at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
	at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
	at androidx.lifecycle.LiveData$1.run(LiveData.java:93)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7870)
	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)

Contributor guide

Open the contributing guide

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 with AccountSwitcherDialog.java at line 70 and reproduce the sign-out, back-navigation, and profile-picture flow described in the issue. Inspect how the login view handles Android back navigation and how the account state reaches AccountSwitcherDialog. Done means the login view cannot return to the signed-out notes screen and reopening the profile controls does not crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
authentication, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.