fix crash

This commit is contained in:
Dylan Conway
2024-01-30 13:44:00 -08:00
parent 8fdb46cb91
commit 82829c5925

View File

@@ -5302,6 +5302,7 @@ pub fn convertUTF8toUTF16InBuffer(
//
// the reason i didn't implement the fallback is purely because our
// code in this file is too chaotic. it is left as a TODO
if (input.len == 0) return &[_]u16{};
const result = bun.simdutf.convert.utf8.to.utf16.le(input, buf);
return buf[0..result];
}
@@ -5312,6 +5313,7 @@ pub fn convertUTF16toUTF8InBuffer(
) ![]const u8 {
// See above
if (input.len == 0) return &[_]u8{};
const result = bun.simdutf.convert.utf16.to.utf8.le(input, buf);
// switch (result.status) {
// .success => return buf[0..result.count],