mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix<Validations>: fix crash reported by https://gitee.com/sourcegit/sourcegit/issues/I452PA
This commit is contained in:
parent
c3c54e154b
commit
6f61c79e8b
2 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ namespace SourceGit.Views.Validations {
|
||||||
|
|
||||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
||||||
var name = value as string;
|
var name = value as string;
|
||||||
if (string.IsNullOrEmpty(name)) new ValidationResult(false, App.Text("EmptyBranchName"));
|
if (string.IsNullOrEmpty(name)) return new ValidationResult(false, App.Text("EmptyBranchName"));
|
||||||
if (!REG_FORMAT.IsMatch(name)) return new ValidationResult(false, App.Text("BadBranchName"));
|
if (!REG_FORMAT.IsMatch(name)) return new ValidationResult(false, App.Text("BadBranchName"));
|
||||||
|
|
||||||
name = Prefix + name;
|
name = Prefix + name;
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace SourceGit.Views.Validations {
|
||||||
|
|
||||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
||||||
var name = value as string;
|
var name = value as string;
|
||||||
if (string.IsNullOrEmpty(name)) new ValidationResult(false, App.Text("EmptyTagName"));
|
if (string.IsNullOrEmpty(name)) return new ValidationResult(false, App.Text("EmptyTagName"));
|
||||||
if (!REG_FORMAT.IsMatch(name)) return new ValidationResult(false, App.Text("BadTagName"));
|
if (!REG_FORMAT.IsMatch(name)) return new ValidationResult(false, App.Text("BadTagName"));
|
||||||
|
|
||||||
foreach (var t in Tags) {
|
foreach (var t in Tags) {
|
||||||
|
|
Loading…
Reference in a new issue