Don't crash on non-numeric element counts.
This commit is contained in:
parent
645abc5ab1
commit
b5aff5dfaf
1 changed files with 10 additions and 2 deletions
|
@ -95,9 +95,17 @@ namespace Bind
|
|||
|
||||
string element_count = param.GetAttribute("elementcount", String.Empty);
|
||||
if (String.IsNullOrEmpty(element_count))
|
||||
{
|
||||
element_count = param.GetAttribute("count", String.Empty);
|
||||
if (!String.IsNullOrEmpty(element_count))
|
||||
p.ElementCount = Int32.Parse(element_count);
|
||||
if (!String.IsNullOrEmpty(element_count))
|
||||
{
|
||||
int count;
|
||||
if (Int32.TryParse(element_count, out count))
|
||||
{
|
||||
p.ElementCount = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty));
|
||||
|
||||
|
|
Loading…
Reference in a new issue