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

Bug/Crash after switching to WYSIWYG and back on new note

Open keunes opened this issue 2 years ago • 0 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

When switching back from WYSIWYG to plain text on a new note, the crash screen is shown.

To Reproduce Steps to reproduce the behavior:

  1. Search for a note
  2. Create a new note (name = search text)
  3. Add link copied from clipboard in body
  4. Tap WYSIWYG button (respective interface opens)
  5. Tap WYSIWYG button again (empty body for note)
  6. Attempt pasting link again
  7. 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)

keunes avatar Apr 16 '23 06:04 keunes