You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Fix error logging
ok_or will unconditionally creates a LoggedResult, which prints an error even it successes. Use ok_or_else which lazily creates a LoggedResult only if it fails.
This commit is contained in:
@@ -157,9 +157,11 @@ fn do_extract_boot_from_payload(
|
||||
for ext in operation.dst_extents.iter() {
|
||||
let out_seek = ext
|
||||
.start_block
|
||||
.ok_or(bad_payload!("start block not found"))?
|
||||
.ok_or_else(|| bad_payload!("start block not found"))?
|
||||
* block_size;
|
||||
let num_blocks = ext.num_blocks.ok_or(bad_payload!("num blocks not found"))?;
|
||||
let num_blocks = ext
|
||||
.num_blocks
|
||||
.ok_or_else(|| bad_payload!("num blocks not found"))?;
|
||||
out_file.seek(SeekFrom::Start(out_seek))?;
|
||||
out_file.write_zeros(num_blocks as usize)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user