mac: Fix crash in watcher caused by the config not being there yet for the watcher. Fixes #305

This commit is contained in:
Hylke Bons 2011-09-22 19:32:47 +01:00
parent ee80e5dfef
commit b1d84eff53

View file

@ -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;