notes-android
notes-android copied to clipboard
Bug/Crash after switching to WYSIWYG and back on new note
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
When switching back from WYSIWYG to plain text on a new note, the crash screen is shown.
To Reproduce Steps to reproduce the behavior:
- Search for a note
- Create a new note (name = search text)
- Add link copied from clipboard in body
- Tap WYSIWYG button (respective interface opens)
- Tap WYSIWYG button again (empty body for note)
- Attempt pasting link again
- See error (not sure if the menu with 'paste' actually showed up, if the error was shown directly after long-pressing, or if it just happened a second after closing WYSIWYG mode)
Expected behavior
Text is maintained and app doesn't crash, even if server didn't catch up on creation yet.
Screenshots
Smartphone (please complete the following information):
App Version: 4.0.0
App Version Code: 40000090
App Flavor: play
Files App Version Code: 30240290
---
OS Version: 4.9.337-perf+(gms-0b368514)
OS API Level: 30
Device: FP3
Manufacturer: Fairphone
Model (and Product): FP3 (FP3)
---
java.lang.NullPointerException: Attempt to invoke virtual method 'long it.niedermann.owncloud.notes.persistence.entity.Note.getId()' on a null object reference
at it.niedermann.owncloud.notes.edit.BaseNoteFragment.onCloseNote(BaseNoteFragment.java:299)
at it.niedermann.owncloud.notes.edit.EditNoteActivity.close(EditNoteActivity.java:373)
at it.niedermann.owncloud.notes.edit.EditNoteActivity.onOptionsItemSelected(EditNoteActivity.java:344)
at android.app.Activity.onMenuItemSelected(Activity.java:4269)
at androidx.activity.ComponentActivity.onMenuItemSelected(ComponentActivity.java:529)
at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:265)
at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:269)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:110)
at androidx.appcompat.widget.ToolbarWidgetWrapper$1.onClick(ToolbarWidgetWrapper.java:188)
at android.view.View.performClick(View.java:7448)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28309)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)