Add fix to avoid exception on Rows with no children

This commit is contained in:
Jeppe Roi Kristensen
2023-06-12 21:03:13 +02:00
committed by Patrik Svensson
parent d484e832f5
commit e0ded712e8
4 changed files with 37 additions and 4 deletions

View File

@ -37,10 +37,15 @@ public sealed class Rows : Renderable, IExpandable
}
else
{
var measurements = _children.Select(c => c.Measure(options, maxWidth));
return new Measurement(
measurements.Min(c => c.Min),
measurements.Min(c => c.Max));
var measurements = _children.Select(c => c.Measure(options, maxWidth)).ToArray();
if (measurements.Length > 0)
{
return new Measurement(
measurements.Min(c => c.Min),
measurements.Min(c => c.Max));
}
return new Measurement(0, 0);
}
}