Check that lines at least has one line, to prevent infinite loop

This commit is contained in:
Michael Votaw
2025-03-24 22:21:19 -07:00
committed by teejusb
parent ad2f895df1
commit 90bdb5e2a6
+1 -1
View File
@@ -869,7 +869,7 @@ RString Steps::MinimizedChartString()
bool minimal = false;
std::vector<RString> lines;
split(measures[m], "\n", lines, true);
while (!minimal && lines.size() % 2 == 0)
while (lines.size() > 0 && !minimal && lines.size() % 2 == 0)
{
// If every other line is all 0s, we can minimize the measure
for (unsigned i = 1; i < lines.size(); i += 2)