mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +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
|
String TextDocument::text_in_range(const TextRange& a_range) const
|
||||||
{
|
{
|
||||||
|
if (is_empty())
|
||||||
|
return String("");
|
||||||
auto range = a_range.normalized();
|
auto range = a_range.normalized();
|
||||||
|
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue