ramack / ActivityDiary

Android diary for any kind of activities
GNU General Public License v3.0
73 stars 37 forks source link

Deleted activity cannot be recovered correctly #311

Open sjl872964789 opened 1 year ago

sjl872964789 commented 1 year ago

Smartphone

Steps to Reproduce

Explain what you did to encounter the issue

  1. Add a new activity "test"
  2. Delete the activity "test"
  3. Open "Edit Activities"
  4. Click "show deleted"
  5. Click the deleted activity "test"
  6. Click on "ok"
  7. The activity "test" still does not exist in the main interface
  8. Open the activity from "Edit Activities"
  9. Enter "test"
  10. Click "save"
  11. Click on the "Reject current edit and open existing activity with same name instead"
  12. Crash

Expected behavior

The deleted activity can be restored without crashing

Video

https://user-images.githubusercontent.com/15941953/182846376-a3dc4c9c-7073-4517-872f-180e4efdc440.mp4

Logcat

08-04 11:54:59.035   525   525 E AndroidRuntime: FATAL EXCEPTION: main
08-04 11:54:59.035   525   525 E AndroidRuntime: Process: de.rampro.activitydiary, PID: 525
08-04 11:54:59.035   525   525 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String de.rampro.activitydiary.model.DiaryActivity.getName()' on a null object reference
08-04 11:54:59.035   525   525 E AndroidRuntime:        at de.rampro.activitydiary.ui.generic.EditActivity$QHandler$3.onClick(EditActivity.java:202)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at android.view.View.performClick(View.java:6256)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at android.view.View$PerformClick.run(View.java:24701)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:789)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:98)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:164)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6541)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
08-04 11:54:59.035   525   525 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
sjl872964789 commented 1 year ago

Hi,any update about this issue?It would be really appreciated to get your concern on this.