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:
parent
44f10217f6
commit
60273631f3
|
@ -45,6 +45,9 @@ namespace SparkleLib {
|
||||||
string output = git.StandardOutput.ReadToEnd ();
|
string output = git.StandardOutput.ReadToEnd ();
|
||||||
git.WaitForExit ();
|
git.WaitForExit ();
|
||||||
|
|
||||||
|
if (output.Length < 40)
|
||||||
|
return null;
|
||||||
|
|
||||||
return output.Substring (0, 40);
|
return output.Substring (0, 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,6 +203,9 @@ namespace SparkleShare {
|
||||||
if (html == null)
|
if (html == null)
|
||||||
html = Controller.HTML;
|
html = Controller.HTML;
|
||||||
|
|
||||||
|
if (html == null)
|
||||||
|
return;
|
||||||
|
|
||||||
html = html.Replace ("<!-- $body-font-size -->", (double) (Style.FontDescription.Size / 1024 + 3) + "px");
|
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 ("<!-- $day-entry-header-font-size -->", (Style.FontDescription.Size / 1024 + 3) + "px");
|
||||||
html = html.Replace ("<!-- $a-color -->", "#0085cf");
|
html = html.Replace ("<!-- $a-color -->", "#0085cf");
|
||||||
|
|
Loading…
Reference in a new issue