File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/multichain-api-middleware/src/handlers Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import type {
9
9
JsonRpcEngineEndCallback ,
10
10
} from '@metamask/json-rpc-engine' ;
11
11
import {
12
+ CaveatMutatorOperation ,
12
13
PermissionDoesNotExistError ,
13
14
UnrecognizedSubjectError ,
14
15
} from '@metamask/permission-controller' ;
@@ -37,10 +38,17 @@ function partialRevokePermissions(
37
38
) . value ;
38
39
39
40
for ( const scopeString of scopes ) {
40
- updatedCaveatValue = Caip25CaveatMutators [ Caip25CaveatType ] . removeScope (
41
+ const result = Caip25CaveatMutators [ Caip25CaveatType ] . removeScope (
41
42
updatedCaveatValue ,
42
43
scopeString ,
43
- ) ?. value ?? {
44
+ ) ;
45
+
46
+ // If operation is a Noop, it means a scope was passed that was not present in the permission, so we proceed with the loop
47
+ if ( result . operation === CaveatMutatorOperation . Noop ) {
48
+ continue ;
49
+ }
50
+
51
+ updatedCaveatValue = result ?. value ?? {
44
52
requiredScopes : { } ,
45
53
optionalScopes : { } ,
46
54
sessionProperties : { } ,
You can’t perform that action at this time.
0 commit comments