String::fromUTF8() crashes when passed a null pointer. This behaviour is inconsistent with the other constructors, which return a null String() in this case: String::String(const char* str) { if (!str) return; m_impl = StringImpl::create(str); } String::String(const char* str, unsigned length) { if (!str) return; m_impl = StringImpl::create(str, length); } Fix attached. This allows us to simplify (or avoid) null checking logic wherever String::fromUTF8() is used.
Created attachment 22692 [details] Add null checks
Comment on attachment 22692 [details] Add null checks Looks fine.
landed in r35623