mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
AK+Everywhere: Make UTF-16 to UTF-8 converter fallible
This could fail to allocate the underlying storage needed to store the UTF-8 data. Propagate this error.
This commit is contained in:
parent
1edb96376b
commit
d793262beb
10 changed files with 25 additions and 22 deletions
|
@ -68,7 +68,8 @@ DeprecatedString const& PrimitiveString::deprecated_string() const
|
|||
{
|
||||
resolve_rope_if_needed();
|
||||
if (!m_has_utf8_string) {
|
||||
m_utf8_string = m_utf16_string.to_utf8();
|
||||
// FIXME: Propagate this error.
|
||||
m_utf8_string = MUST(m_utf16_string.to_utf8(vm()));
|
||||
m_has_utf8_string = true;
|
||||
}
|
||||
return m_utf8_string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue