mac: fix crash in watcher. closes #1190

This commit is contained in:
Hylke Bons 2013-02-28 19:36:59 +00:00
parent 1e2e253f5b
commit 613b99b8dd

View file

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