[longomatch] Fix segfault loading subcategories



commit 8db271dd8aff6f915622d03e04731a3bd7623633
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu May 29 15:01:20 2014 +0200

    Fix segfault loading subcategories

 LongoMatch.GUI/Gui/Component/CategoryProperties.cs |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs 
b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
index b7f647a..901efb6 100644
--- a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
+++ b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
@@ -70,7 +70,7 @@ namespace LongoMatch.Gui.Component
                
                public void LoadSubcategories() {
                        subcategoriesProvider = Config.SubcategoriesTemplatesProvider;
-                       LoadSubcategories();
+                       LoadSubcategories(null);
                }
                
                private void LoadSubcategories(List<PlayerSubCategory> playerSubcategories) {
@@ -84,12 +84,14 @@ namespace LongoMatch.Gui.Component
                                                                 subcat.Name),
                                                   subcat);
                        }
-                       foreach (PlayerSubCategory subcat in playerSubcategories) {
-                               Log.Debug("Adding player subcategory: ", subcat.Name);
-                               model.AppendValues(String.Format("[{0}] {1}", 
-                                                                Catalog.GetString("Players"),
-                                                                subcat.Name),
-                                                  subcat);
+                       if (playerSubcategories != null) {
+                               foreach (PlayerSubCategory subcat in playerSubcategories) {
+                                       Log.Debug("Adding player subcategory: ", subcat.Name);
+                                       model.AppendValues(String.Format("[{0}] {1}", 
+                                                                        Catalog.GetString("Players"),
+                                                                        subcat.Name),
+                                                          subcat);
+                               }
                        }
                        
                        subcatcombobox.Model = model;


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