mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Add fix to avoid exception on Rows with no children
This commit is contained in:

committed by
Patrik Svensson

parent
d484e832f5
commit
e0ded712e8
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user