diff --git a/AK/StringImpl.cpp b/AK/StringImpl.cpp index 6ccb4810750..5e8c6d9090c 100644 --- a/AK/StringImpl.cpp +++ b/AK/StringImpl.cpp @@ -76,7 +76,7 @@ RefPtr StringImpl::create(const char* cstring, int length, ShouldCho if (!cstring) return nullptr; - if (!*cstring) + if (!length || !*cstring) return the_empty_stringimpl(); if (should_chomp) {