Merge pull request #13 from Birch-san/out-of-bounds
Guard against out-of-bounds
This commit is contained in:
		@ -175,9 +175,11 @@ void TableComponent::paintCell (
 | 
				
			|||||||
    g.setColour (getLookAndFeel().findColour (ListBox::textColourId));
 | 
					    g.setColour (getLookAndFeel().findColour (ListBox::textColourId));
 | 
				
			||||||
    g.setFont (font);
 | 
					    g.setFont (font);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TableRow& row{rows[rowNumber]};
 | 
						if (rowNumber < rows.size()) {
 | 
				
			||||||
    String text{row.getStringContents(columnId)};
 | 
							TableRow& row{ rows[rowNumber] };
 | 
				
			||||||
    g.drawText (text, 2, 0, width - 4, height, Justification::centredLeft, true);
 | 
							String text{ row.getStringContents(columnId) };
 | 
				
			||||||
 | 
							g.drawText(text, 2, 0, width - 4, height, Justification::centredLeft, true);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    g.setColour (getLookAndFeel().findColour (ListBox::backgroundColourId));
 | 
					    g.setColour (getLookAndFeel().findColour (ListBox::backgroundColourId));
 | 
				
			||||||
    g.fillRect (width - 1, 0, 1, height);
 | 
					    g.fillRect (width - 1, 0, 1, height);
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user