nextcloud / nextcloud/notes-android

Crash - Note.getScrollY() on a null object reference

Open
#2,126 2 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

This issue respects the following points:
Describe the bug

I don't have clear steps but I believe this occurred switching back to one of the app's windows. Only seen with 4.2.0. I thought the stack trace might be useful anyway.

My gut feeling is maybe it was switching back to the window which had a note open, but the window had dropped out of memory? It's a guess, based a little also on the stack trace.

In which case it would be:

  1. Open Notes
  2. Open a note, that for some reason now creates its own window
  3. Do a whole bunch of other things, pushing the app out of memory
  4. Switch back to that single note window
  5. Maybe??

If I see it recurring I'll update the steps. If not useful the issue can be deleted.

Expected behavior

Not to crash

Notes Android version

4.2.0

Notes server version

4.9.4

Nextcloud Android version

3.28.1

Nextcloud version

28.0.3

Device

Google Pixel 6a

Android Version

14

App Store
  • Google Play Store
  • F-Droid
  • Huawei App Gallery
Stacktrace

App Version: 4.2.0
App Version Code: 40020090
App Flavor: fdroid

Files App Version Code: 30280190 (PROD)


OS Version: 5.10.209-android13-4-g6ef5c4eb0baf(2024040300)
OS API Level: 34
Device: bluejay
Manufacturer: Google
Model (and Product): Pixel 6a (bluejay)


java.lang.NullPointerException: Attempt to invoke virtual method 'int it.niedermann.owncloud.notes.persistence.entity.Note.getScrollY()' on a null object reference
	at it.niedermann.owncloud.notes.edit.BaseNoteFragment.onNoteLoaded(BaseNoteFragment.java:274)
	at it.niedermann.owncloud.notes.edit.NoteEditFragment.onNoteLoaded(NoteEditFragment.java:157)
	at it.niedermann.owncloud.notes.edit.BaseNoteFragment.lambda$onViewCreated$0(BaseNoteFragment.java:110)
	at it.niedermann.owncloud.notes.edit.BaseNoteFragment.$r8$lambda$5_wfjXQvs3EOv9qlGCc-xBHm2W0(Unknown Source:0)
	at it.niedermann.owncloud.notes.edit.BaseNoteFragment$$ExternalSyntheticLambda6.run(Unknown Source:2)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:49)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)

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 BaseNoteFragment.onNoteLoaded at line 274 and follow the call from onViewCreated, then inspect NoteEditFragment.onNoteLoaded at line 157. Reproduce the reported window and memory-pressure scenario if possible; done means returning to the note window no longer crashes when the loaded Note is unavailable.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.