Added logic to verify that a section number is a valid number rather than crashing on an invalid number.
This commit is contained in:
parent
760aa9d90e
commit
4765587f4d
@ -4883,7 +4883,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// if the section's tab is a letter, we don't want a 0 on the section.... for example A.0.
|
// if the section's tab is a letter, we don't want a 0 on the section.... for example A.0.
|
||||||
if (IsSection && tmpstr == null && System.Char.IsLetter(DisplayNumber, 0)) return -1;
|
if (IsSection && tmpstr == null && System.Char.IsLetter(DisplayNumber, 0)) return -1;
|
||||||
if (tmpstr != null && tmpstr.IndexOf('-') >= 0) return -1;
|
if (tmpstr != null && tmpstr.IndexOf('-') >= 0) return -1;
|
||||||
return tmpstr==null?0:System.Convert.ToInt32(tmpstr);
|
if (tmpstr == null) return 0;
|
||||||
|
Int32 x;
|
||||||
|
if(Int32.TryParse(tmpstr, out x))return x;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user