GNOME Bugzilla – Bug 375380
Crashing when loading a modified NotOfTheDay
Last modified: 2008-02-26 20:46:18 UTC
Steps to reproduce: 1. Edit a newly created NodD note (make tomboy save it by editing it) 2. Restart Tomboy 3. Tomboy crashes Stack trace: Unhandled Exception: System.Exception: A note with this title already exists at Tomboy.NoteManager.Create (string,string) <0x0016d> at NoteOfTheDay.Create (Tomboy.NoteManager,System.DateTime) <0x0004f> at NoteOfTheDayPlugin.CheckNewDay (object,System.EventArgs) <0x00165> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_void_object_EventArgs (object,System.EventArgs) <0x00041> at Tomboy.InterruptableTimeout.TimeoutExpired () <0x00019> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_bool () <0x00037> at TimeoutProxy.Handler () <0x0002a> at (wrapper native-to-managed) TimeoutProxy.Handler () <0x00036> in (unmanaged) 0xb7f4edd5 at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004> at Gtk.Application.Run () <0x00007> at Gnome.Program.Run () <0x00007> at Tomboy.Application.StartMainLoop () <0x00014> at Tomboy.Tomboy.StartTrayIcon () <0x00040> at Tomboy.Tomboy.Main (string[]) <0x00128> Other information:
Created attachment 76616 [details] [review] Keeps the CreateDate read from the file instead of overwriting with DateTime.MinValue On Note.CreateExistingNote() the data.CreateDate property read from the disk was overwritten by DateTime.MinValue. Then back on NoteOfTheDayPlugin.CheckNewDay() the NoteManager would find the saved note with a different creation date from today and would try to create a new note with the same name.
Created attachment 76667 [details] [review] Also prevents NoteOfTheDay from crashing Tomboy I also noticed this bug today. This patch additionally adds a try/catch statement around the NoteOfTheDay code that calls NoteManager.Create () just in case it fails for other reasons; it will prevent Tomboy from crashing.
Created attachment 76669 [details] [review] Same as before except now logs error to Logger Applied this patch to latest CVS and checked-in. This is now fixed.
Fixed in CVS Head. Will be part of next release.