AK: String::contains() should say no if needle or haystack is null

This commit is contained in:
Andreas Kling 2020-04-11 14:33:05 +02:00
parent 70da0e3fb5
commit c993c7e3dc
Notes: sideshowbarker 2024-07-19 07:42:58 +09:00

View File

@ -312,6 +312,8 @@ bool String::matches(const StringView& mask, CaseSensitivity case_sensitivity) c
bool String::contains(const String& needle) const
{
if (is_null() || needle.is_null())
return false;
return strstr(characters(), needle.characters());
}