Fixed node overview crash when no cores are available
This commit is contained in:
parent
95cfa815fb
commit
eaddefdc8e
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@
|
||||||
@if (NodeStats.ContainsKey(context!.Id) && NodeStats[context.Id] != null)
|
@if (NodeStats.ContainsKey(context!.Id) && NodeStats[context.Id] != null)
|
||||||
{
|
{
|
||||||
var cores = NodeStats[context!.Id]!.Hardware.Cores;
|
var cores = NodeStats[context!.Id]!.Hardware.Cores;
|
||||||
var percent = Math.Round(cores.Average(x => x.Usage), 2);
|
var percent = cores.Any() ? Math.Round(cores.Average(x => x.Usage), 2) : 0;
|
||||||
|
|
||||||
<ColoredBar Value="percent"/>
|
<ColoredBar Value="percent"/>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue