diff --git a/ext/node/ops/util.rs b/ext/node/ops/util.rs index 1af4f7edbd9206..94268862202daf 100644 --- a/ext/node/ops/util.rs +++ b/ext/node/ops/util.rs @@ -18,18 +18,18 @@ enum HandleType { } #[op2(fast)] -pub fn op_node_guess_handle_type( - state: &mut OpState, - rid: u32, -) -> Result { - let handle = state.resource_table.get_handle(rid)?; +pub fn op_node_guess_handle_type(state: &mut OpState, rid: u32) -> u32 { + let handle = match state.resource_table.get_handle(rid) { + Ok(handle) => handle, + _ => return HandleType::Unknown as u32, + }; let handle_type = match handle { ResourceHandle::Fd(handle) => guess_handle_type(handle), _ => HandleType::Unknown, }; - Ok(handle_type as u32) + handle_type as u32 } #[cfg(windows)]