fix crash when entering non digits in the input fields
This commit is contained in:
parent
211c0e834f
commit
0f05ce77d3
Binary file not shown.
@ -36,19 +36,14 @@ namespace PhysFormuler
|
|||||||
{
|
{
|
||||||
if (box.Text != "")
|
if (box.Text != "")
|
||||||
{
|
{
|
||||||
if (Convert.ToDouble(box.Text) != 0)
|
double number;
|
||||||
|
if (Double.TryParse(box.Text,out number))
|
||||||
{
|
{
|
||||||
return true;
|
return !double.IsNaN(number);
|
||||||
}
|
}
|
||||||
else
|
else return false;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update(string type)
|
private void Update(string type)
|
||||||
|
@ -10,4 +10,7 @@
|
|||||||
<FallbackCulture>ru-RU</FallbackCulture>
|
<FallbackCulture>ru-RU</FallbackCulture>
|
||||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<EnableSecurityDebugging>false</EnableSecurityDebugging>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
Reference in New Issue
Block a user