guard against out-of-bounds when looking up what text to write into each row of preset table (which for some reason didn't cause any problems on macOS)
This commit is contained in:
parent
aabb0b1aad
commit
a4374594d4
|
@ -175,9 +175,11 @@ void TableComponent::paintCell (
|
|||
g.setColour (getLookAndFeel().findColour (ListBox::textColourId));
|
||||
g.setFont (font);
|
||||
|
||||
TableRow& row{rows[rowNumber]};
|
||||
String text{row.getStringContents(columnId)};
|
||||
g.drawText (text, 2, 0, width - 4, height, Justification::centredLeft, true);
|
||||
if (rowNumber < rows.size()) {
|
||||
TableRow& row{ rows[rowNumber] };
|
||||
String text{ row.getStringContents(columnId) };
|
||||
g.drawText(text, 2, 0, width - 4, height, Justification::centredLeft, true);
|
||||
}
|
||||
|
||||
g.setColour (getLookAndFeel().findColour (ListBox::backgroundColourId));
|
||||
g.fillRect (width - 1, 0, 1, height);
|
||||
|
|
Loading…
Reference in New Issue
Block a user