1
Fork 0
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:
Cesar Torres 2021-03-14 14:10:55 +01:00 committed by Andreas Kling
parent 4f34a78337
commit 2b269b27e7

View file

@ -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;