mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-25 21:11:02 +00:00
Don't crash on non-numeric element counts.
This commit is contained in:
parent
645abc5ab1
commit
b5aff5dfaf
|
@ -95,9 +95,17 @@ namespace Bind
|
||||||
|
|
||||||
string element_count = param.GetAttribute("elementcount", String.Empty);
|
string element_count = param.GetAttribute("elementcount", String.Empty);
|
||||||
if (String.IsNullOrEmpty(element_count))
|
if (String.IsNullOrEmpty(element_count))
|
||||||
|
{
|
||||||
element_count = param.GetAttribute("count", String.Empty);
|
element_count = param.GetAttribute("count", String.Empty);
|
||||||
if (!String.IsNullOrEmpty(element_count))
|
if (!String.IsNullOrEmpty(element_count))
|
||||||
p.ElementCount = Int32.Parse(element_count);
|
{
|
||||||
|
int count;
|
||||||
|
if (Int32.TryParse(element_count, out count))
|
||||||
|
{
|
||||||
|
p.ElementCount = count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty));
|
p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue