avoid crash if remote folder is deleted by user.

When all files including the .git folder are removed from a remote folder, but that folder is not removed from the SparkleShare config, SparkleShare crashes at startup, and when showing the log for that folder. This commit should avoid a crash.
This commit is contained in:
wimh 2011-08-21 01:18:03 +02:00
parent 44f10217f6
commit 60273631f3
2 changed files with 6 additions and 0 deletions

View file

@ -45,6 +45,9 @@ namespace SparkleLib {
string output = git.StandardOutput.ReadToEnd ();
git.WaitForExit ();
if (output.Length < 40)
return null;
return output.Substring (0, 40);
}
}

View file

@ -203,6 +203,9 @@ namespace SparkleShare {
if (html == null)
html = Controller.HTML;
if (html == null)
return;
html = html.Replace ("<!-- $body-font-size -->", (double) (Style.FontDescription.Size / 1024 + 3) + "px");
html = html.Replace ("<!-- $day-entry-header-font-size -->", (Style.FontDescription.Size / 1024 + 3) + "px");
html = html.Replace ("<!-- $a-color -->", "#0085cf");