[f-spot] prevent against FileNotFound while populating context menu



commit 0fb0b002ed361e653ab7227dfc2e19714622eea1
Author: Stephane Delcroix <stephane delcroix org>
Date:   Fri Jul 3 15:06:28 2009 +0200

    prevent against FileNotFound while populating context menu

 src/MainWindow.cs |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/MainWindow.cs b/src/MainWindow.cs
index e773107..82cbf08 100644
--- a/src/MainWindow.cs
+++ b/src/MainWindow.cs
@@ -3099,7 +3099,12 @@ public class MainWindow {
 		List<string> contents = new List<string> ();
 
 		foreach (Photo p in SelectedPhotos ()) {
-			string content = GLib.FileFactory.NewForUri (p.DefaultVersionUri).QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null).ContentType;
+			string content;
+			try {
+				content = GLib.FileFactory.NewForUri (p.DefaultVersionUri).QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null).ContentType;
+			} catch (GLib.GException) {
+				content = null;
+			}
 
 			if (! contents.Contains (content))
 				contents.Add (content);



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