Fixed ExternalMonitoringUnit when external program returns Nan or Inf

This commit is contained in:
ftc
2025-06-12 11:23:41 +03:00
parent 624a6e1505
commit 9fdf6262f7
+7
View File
@@ -58,9 +58,16 @@ namespace Barsik
result = result.Trim();
float resultFloat;
if (float.TryParse(result, out resultFloat))
{
if (float.IsNaN(resultFloat) || float.IsInfinity(resultFloat))
{
logger.Error("Nan or Inf received from " + program + " with args " + args);
}
else
{
registers.SetFloat(baseAddress, resultFloat);
}
}
else
{
logger.Error("Non-float result from process " + program + " with args " + args);