[blam] ItemStore: Create the items file if nonexistant



commit b205dc761f23c733a60c6058315fa06894a190fc
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Tue Mar 1 15:48:14 2011 +0100

    ItemStore: Create the items file if nonexistant
    
    Signed-off-by: Carlos Martín Nieto <carlos cmartin tk>

 src/ItemStore.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/ItemStore.cs b/src/ItemStore.cs
index 766438c..ced5d76 100644
--- a/src/ItemStore.cs
+++ b/src/ItemStore.cs
@@ -67,7 +67,11 @@ namespace Imendio.Blam
             XmlReader reader;
             try{
                 reader = new XmlTextReader(itemfile);
-            } catch(Exception e){
+            } catch(FileNotFoundException e){
+                File.Create(itemfile);
+                reader = new XmlTextReader(itemfile);
+            }
+            catch(Exception e){
                 Console.WriteLine(e.Message);
                 Console.WriteLine("item file not found");
                 return;



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