mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
less: Fix crash on empty input
This commit is contained in:
parent
a69598a670
commit
f9c4f65e1f
Notes:
sideshowbarker
2024-07-17 21:27:47 +09:00
Author: https://github.com/Rummskartoffel
Commit: f9c4f65e1f
Pull-request: https://github.com/SerenityOS/serenity/pull/11641
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/linusg
1 changed files with 5 additions and 0 deletions
|
@ -428,6 +428,11 @@ private:
|
|||
|
||||
void calculate_end()
|
||||
{
|
||||
if (m_lines.is_empty()) {
|
||||
m_end_line = 0;
|
||||
m_end_subline = 0;
|
||||
return;
|
||||
}
|
||||
size_t end_line = m_lines.size() - 1;
|
||||
size_t end_subline = sublines(end_line).size() - 1;
|
||||
line_subline_add(end_line, end_subline, -(m_height - 1), false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue