mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
enhance: avoid crash when missing parameters to format string
This commit is contained in:
parent
f79dc1f91f
commit
2f6519fa4d
1 changed files with 4 additions and 0 deletions
|
@ -191,6 +191,10 @@ namespace SourceGit
|
||||||
var fmt = Current.FindResource($"Text.{key}") as string;
|
var fmt = Current.FindResource($"Text.{key}") as string;
|
||||||
if (string.IsNullOrWhiteSpace(fmt))
|
if (string.IsNullOrWhiteSpace(fmt))
|
||||||
return $"Text.{key}";
|
return $"Text.{key}";
|
||||||
|
|
||||||
|
if (args == null || args.Length == 0)
|
||||||
|
return fmt;
|
||||||
|
|
||||||
return string.Format(fmt, args);
|
return string.Format(fmt, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue