[tomboy] Prevent NRE exposed by previous commit



commit b5c481da5e9dafd6973411c640c05b243e01dba1
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Sun Jul 25 21:56:21 2010 -0700

    Prevent NRE exposed by previous commit
    
    Signed-off-by: Aaron Borden <adborden live com>

 Tomboy/Watchers.cs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/Tomboy/Watchers.cs b/Tomboy/Watchers.cs
index f700925..2be096d 100644
--- a/Tomboy/Watchers.cs
+++ b/Tomboy/Watchers.cs
@@ -1135,8 +1135,8 @@ namespace Tomboy
 		void OnTagRemoved (Note note, string tag_name)
 		{
 			Tag tag = TagManager.GetTag (tag_name);
-			Logger.Debug ("Watchers.OnTagRemoved popularity count: {0}", tag.Popularity);
-			if (tag.Popularity == 0)
+			Logger.Debug ("Watchers.OnTagRemoved popularity count: {0}", tag != null ? tag.Popularity : 0);
+			if (tag != null && tag.Popularity == 0)
 				TagManager.RemoveTag (tag);
 		}
 	}



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