mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibGUI: Fix crash when text_in_range() was called on an empty document
This commit is contained in:
parent
4f34a78337
commit
2b269b27e7
1 changed files with 2 additions and 0 deletions
|
@ -315,6 +315,8 @@ String TextDocument::text() const
|
|||
|
||||
String TextDocument::text_in_range(const TextRange& a_range) const
|
||||
{
|
||||
if (is_empty())
|
||||
return String("");
|
||||
auto range = a_range.normalized();
|
||||
|
||||
StringBuilder builder;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue