From fc8f060ee3e87c81a2073279a2720b423965d68f Mon Sep 17 00:00:00 2001 From: liruifengv Date: Sat, 2 Dec 2023 01:45:51 +0800 Subject: fix(permissions): fix panics when revoking net permission (#21388) fix #21385 --- runtime/permissions/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/permissions') diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs index 34d7f0a1b..cb1af7619 100644 --- a/runtime/permissions/mod.rs +++ b/runtime/permissions/mod.rs @@ -856,7 +856,7 @@ impl UnaryPermission { &mut self, host: Option<&(T, Option)>, ) -> PermissionState { - self.revoke_desc(&Some(NetDescriptor::new(&host.unwrap()))) + self.revoke_desc(&host.map(|h| NetDescriptor::new(&h))) } pub fn check>( -- cgit v1.2.3