mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
AK: Avoid nullptr deref in DeprecatedString(DeprecatedFlyString const&)
Prior to this commit, constructing a DS from a null DFS would cause a nullptr deref, which broke (at least) Profiler. This commit converts the null DFS to an empty DS, avoiding the nullptr deref (until DFS loses its null state, or we decide to not make it convertible to a DS).
This commit is contained in:
parent
a8f0fa5dd4
commit
867f7da017
1 changed files with 1 additions and 1 deletions
|
@ -374,7 +374,7 @@ DeprecatedString escape_html_entities(StringView html)
|
|||
}
|
||||
|
||||
DeprecatedString::DeprecatedString(DeprecatedFlyString const& string)
|
||||
: m_impl(*string.impl())
|
||||
: m_impl(*(string.impl() ?: &StringImpl::the_empty_stringimpl()))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue