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
commit 2b269b27e7
Notes: sideshowbarker 2024-07-18 21:20:37 +09:00

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;