[longomatch] Initilialize projects without the GamePeriods string



commit 9cae274c3bfbb51ad69cdc5c3bebfcb5a747df6c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Jun 3 19:09:42 2014 +0200

    Initilialize projects without the GamePeriods string

 .../Store/Templates/CategoriesTemplate.cs          |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs 
b/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
index 1cbd6e5..c04487f 100644
--- a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
+++ b/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
@@ -189,7 +189,13 @@ namespace LongoMatch.Store.Templates
                }
 
                public static Categories Load(string filePath) {
-                       return SerializableObject.LoadSafe<Categories>(filePath);
+                       Categories cat = SerializableObject.LoadSafe<Categories>(filePath);
+                       if (cat.GamePeriods == null) {
+                               cat.GamePeriods = new List<string>();
+                               cat.GamePeriods.Add ("1");
+                               cat.GamePeriods.Add ("2");
+                       }
+                       return cat;
                }
 
                public static Categories DefaultTemplate(int count) {


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