notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

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

Open rainloreley opened this issue 3 years ago • 3 comments

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)

rainloreley avatar Sep 22 '22 07:09 rainloreley

Hi,

I might have the same issue and I can auf some Screenshots.

Fresh Install of App in Version 3.6 on Android 11. Server: 24.0.2 / notes App: 4.5.1

After selecting the Account (1.screenshot) the Dialog, the Error appears. (2.screenshot) When clicking in the backbutton afterwards, the View Shows an empty list and on clicking in "+" it states that there ist no account created. (3.screenshot).

Also tested: Second Account (which is working on a different device with the same app version) -> does not work

Screenshots:

Screenshot_20221110-210652_090838 Screenshot_20221110-210657_090837 Screenshot_20221110-210715_090827

computix avatar Nov 10 '22 20:11 computix

@computix your issue is completely unrelated and caused by a bug in the Nextcloud Single Sign On library rather than the Notes Android app. As a workaround select German (Germany) as your language and location in your global device settings. You probably currently have set German (Austria) or German (Swiss) which cause this issue.

stefan-niedermann avatar Nov 10 '22 20:11 stefan-niedermann

Thanks a Lot for pointing me in the right direction. The cause was that I accidentally used nextcloud Dev.

BR Markus

10.11.2022 21:37:45 Niedermann IT-Dienstleistungen @.***>:

@computix[https://github.com/computix] your issue is completely unrelated and caused by a bug in the Nextcloud Single Sign On library[https://github.com/nextcloud/Android-SingleSignOn/issues/456] rather than the Notes Android app. As a workaround select German (Germany) as your language and location in your global device settings. You probably currently have set German (Austria) or German (Swiss) which cause this issue.

— Reply to this email directly, view it on GitHub[https://github.com/stefan-niedermann/nextcloud-notes/issues/1580#issuecomment-1310865410], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABXHD2AAXVDIVVP2KD4MGTTWHVMJRANCNFSM6AAAAAAQSYC6KE]. You are receiving this because you were mentioned.[Verfolgungsbild][https://github.com/notifications/beacon/ABXHD2BLS3OWVSMXJRGI5BLWHVMJRA5CNFSM6AAAAAAQSYC6KGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSOEI4AE.gif]

computix avatar Nov 10 '22 21:11 computix