Fixed ExternalMonitoringUnit when external program returns Nan or Inf
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user