[tomboy] ExportAllApplicationAddin.cs: fix crash when a linked note is not found



commit 18aff247b63767fb3091a25b754c8401da1b82e1
Author: Alex Tereschenko <frozen and blue gmail com>
Date:   Sun Nov 20 18:09:31 2016 +0100

    ExportAllApplicationAddin.cs: fix crash when a linked note is not found
    
    Fixes #25.
    
    Signed-off-by: Alex Tereschenko <frozen and blue gmail com>

 Tomboy/ExportAllApplicationAddin.cs |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/Tomboy/ExportAllApplicationAddin.cs b/Tomboy/ExportAllApplicationAddin.cs
index 0ef514d..4c6146d 100644
--- a/Tomboy/ExportAllApplicationAddin.cs
+++ b/Tomboy/ExportAllApplicationAddin.cs
@@ -508,7 +508,13 @@ namespace Tomboy
                        NoteManager manager = Tomboy.DefaultNoteManager;
                        Note note_to = manager.Find (title_to);
                        string title_from = SanitizeNoteTitle (note_from.Title);
-                       title_to = SanitizeNoteTitle (note_to.Title);
+                       if (note_to != null) {
+                               title_to = SanitizeNoteTitle(note_to.Title);
+                               Logger.Debug("Found linked note '{0}', sanitized title: '{1}'", 
note_to.Title, title_to);
+                       } else {
+                               Logger.Error("Could not find note titled '{0}' to construct a link to it", 
title_to);
+                               return "";
+                       }
 
                        if (exporting_single_notebook) {
                                //If there is only one notebook being exported


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]