mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08: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;
|
||||
if (string.IsNullOrWhiteSpace(fmt))
|
||||
return $"Text.{key}";
|
||||
|
||||
if (args == null || args.Length == 0)
|
||||
return fmt;
|
||||
|
||||
return string.Format(fmt, args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue