f-spot r4411 - trunk/src/Widgets



Author: sdelcroix
Date: Thu Sep 18 07:14:03 2008
New Revision: 4411
URL: http://svn.gnome.org/viewvc/f-spot?rev=4411&view=rev

Log:
fix a crasher on editors


Modified:
   trunk/src/Widgets/EditorPage.cs

Modified: trunk/src/Widgets/EditorPage.cs
==============================================================================
--- trunk/src/Widgets/EditorPage.cs	(original)
+++ trunk/src/Widgets/EditorPage.cs	Thu Sep 18 07:14:03 2008
@@ -168,7 +168,7 @@
 				Apply (editor); // Instant apply
 		}
 
-		private void SetupEditor (Editor editor) {
+		private bool SetupEditor (Editor editor) {
 			EditorState state = editor.CreateState ();
 
 			EditorSelection selection = new EditorSelection ();
@@ -185,13 +185,17 @@
 				state.Selection = null;
 				state.PhotoImageView = null;
 			}
+			if (Page.Sidebar.Selection == null)
+				return false;
 			state.Items = Page.Sidebar.Selection.Items;
 
 			editor.Initialize (state);
+			return true;
 		}
 
 		private void Apply (Editor editor) {
-			SetupEditor (editor);
+			if (!SetupEditor (editor))
+				return;
 
 			if (!editor.CanBeApplied) {
 				string msg = Catalog.GetString ("No selection available");



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