[longomatch] Fix crash doing searchs with a project selected



commit 97ea92f227e2d206315e2ba7fee01f942e96d1d9
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Jan 27 20:45:53 2012 +0100

    Fix crash doing searchs with a project selected

 LongoMatch.GUI/Gui/Dialog/OpenProjectDialog.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Dialog/OpenProjectDialog.cs b/LongoMatch.GUI/Gui/Dialog/OpenProjectDialog.cs
index 36c412b..7e6b53e 100644
--- a/LongoMatch.GUI/Gui/Dialog/OpenProjectDialog.cs
+++ b/LongoMatch.GUI/Gui/Dialog/OpenProjectDialog.cs
@@ -48,7 +48,11 @@ namespace LongoMatch.Gui.Dialog
 		protected virtual void OnProjectlistwidgetProjectsSelected(List<ProjectDescription> projects)
 		{
 			buttonOk.Sensitive = (projects.Count == 1);
-			SelectedProject = projects[0];
+			if (projects.Count > 0) {
+				SelectedProject = projects[0];
+			} else {
+				SelectedProject = null;
+			}
 		}
 	}
 }
\ No newline at end of file



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