mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice()
This commit is contained in:
committed by
Linus Groh
parent
c0486f93d4
commit
c10d48b72c
@@ -202,7 +202,7 @@ constexpr static int USER_VALUES_OFFSET = 32;
|
||||
ErrorOr<void> Heap::read_zero_block()
|
||||
{
|
||||
auto buffer = TRY(read_block(0));
|
||||
auto file_id_buffer = buffer.slice(0, FILE_ID.length());
|
||||
auto file_id_buffer = TRY(buffer.slice(0, FILE_ID.length()));
|
||||
auto file_id = StringView(file_id_buffer);
|
||||
if (file_id != FILE_ID) {
|
||||
warnln("{}: Zero page corrupt. This is probably not a {} heap file"sv, name(), FILE_ID);
|
||||
|
||||
Reference in New Issue
Block a user