mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:47:34 +00:00
LibGUI: Fix crash when getting text of selected line after a line delete
This commit is contained in:
parent
d0664ce6c9
commit
b7d726e226
1 changed files with 1 additions and 1 deletions
|
@ -343,7 +343,7 @@ String TextDocument::text() const
|
||||||
|
|
||||||
String TextDocument::text_in_range(const TextRange& a_range) const
|
String TextDocument::text_in_range(const TextRange& a_range) const
|
||||||
{
|
{
|
||||||
if (is_empty())
|
if (is_empty() || line_count() < a_range.end().line() - a_range.start().line() || line(a_range.start().line()).is_empty())
|
||||||
return String("");
|
return String("");
|
||||||
auto range = a_range.normalized();
|
auto range = a_range.normalized();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue