summaryrefslogtreecommitdiff
path: root/AK/StringBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AK/StringBuilder.cpp')
-rw-r--r--AK/StringBuilder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/StringBuilder.cpp b/AK/StringBuilder.cpp
index 17be5972a9..ffae4e76da 100644
--- a/AK/StringBuilder.cpp
+++ b/AK/StringBuilder.cpp
@@ -91,6 +91,8 @@ ByteBuffer StringBuilder::to_byte_buffer() const
String StringBuilder::to_string() const
{
+ if (is_empty())
+ return String::empty();
return String((const char*)m_buffer.data(), m_length);
}