mac: fix crash in watcher. closes #1190

This commit is contained in:
Hylke Bons 2013-02-28 19:36:59 +00:00
parent cfbb23b452
commit 188672a81b

View file

@ -151,12 +151,14 @@ namespace SparkleShare {
var handler = Changed;
if (handler != null) {
string path = paths [0];
path = path.Substring (Path.Length);
path = path.Trim ("/".ToCharArray ());
if (paths [0].Length >= Path.Length) {
string path = paths [0];
path = path.Substring (Path.Length);
path = path.Trim ("/".ToCharArray ());
if (!string.IsNullOrWhiteSpace (path))
handler (path);
if (!string.IsNullOrWhiteSpace (path))
handler (path);
}
}
GC.KeepAlive (this);