From b1d84eff53371dcb6454bfa5564f2a824373b1f7 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 22 Sep 2011 19:32:47 +0100 Subject: [PATCH] mac: Fix crash in watcher caused by the config not being there yet for the watcher. Fixes #305 --- SparkleShare/Mac/SparkleMacController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SparkleShare/Mac/SparkleMacController.cs b/SparkleShare/Mac/SparkleMacController.cs index 22833d7a..fd7a97c1 100755 --- a/SparkleShare/Mac/SparkleMacController.cs +++ b/SparkleShare/Mac/SparkleMacController.cs @@ -30,7 +30,7 @@ namespace SparkleShare { // We have to use our own custom made folder watcher, as // System.IO.FileSystemWatcher fails watching subfolders on Mac - private SparkleMacWatcher watcher = new SparkleMacWatcher (SparkleConfig.DefaultConfig.FoldersPath); + private SparkleMacWatcher watcher; public SparkleMacController () : base () { } @@ -109,6 +109,8 @@ namespace SparkleShare { // Creates the SparkleShare folder in the user's home folder public override bool CreateSparkleShareFolder () { + this.watcher = new SparkleMacWatcher (SparkleConfig.DefaultConfig.FoldersPath); + if (!Directory.Exists (SparkleConfig.DefaultConfig.FoldersPath)) { Directory.CreateDirectory (SparkleConfig.DefaultConfig.FoldersPath); return true;