mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibWeb: Check if line name is present in GridTrackSizeList::to_string()
Fixes crash in GridTrackSizeList::to_string() when line names are missing.
This commit is contained in:
parent
0c5d6c6c47
commit
b49e9d2eab
1 changed files with 2 additions and 2 deletions
|
@ -189,7 +189,7 @@ ErrorOr<String> GridTrackSizeList::to_string() const
|
|||
};
|
||||
|
||||
for (size_t i = 0; i < m_track_list.size(); ++i) {
|
||||
if (m_line_names[i].size() > 0) {
|
||||
if (m_line_names.size() > 0 && m_line_names[i].size() > 0) {
|
||||
print_line_names(i);
|
||||
builder.append(" "sv);
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ ErrorOr<String> GridTrackSizeList::to_string() const
|
|||
if (i < m_track_list.size() - 1)
|
||||
builder.append(" "sv);
|
||||
}
|
||||
if (m_line_names[m_track_list.size()].size() > 0) {
|
||||
if (m_line_names.size() > 0 && m_line_names[m_track_list.size()].size() > 0) {
|
||||
builder.append(" "sv);
|
||||
print_line_names(m_track_list.size());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue