Skip to content

Commit 8a47a96

Browse files
Fixes an issue cancelling a permission request (#22915)
## **Description** I introduced a bug in #22850 which can be reproduced by going to the test-dapp, starting a permission request flow, proceeding to the next screen and cancelling it again. This fixes the problem by guarding against `permissions` being `null`. ## **Manual testing steps** 1. Go to the test-dapp 2. Connect 3. Click next 4. Click cancel 5. See that the extension does not crash
1 parent 3844eac commit 8a47a96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/components/app/permission-page-container/permission-page-container.component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class PermissionPageContainer extends Component {
5757
state = {};
5858

5959
getRequestedPermissions() {
60-
return Object.entries(this.props.request.permissions).reduce(
60+
return Object.entries(this.props.request.permissions ?? {}).reduce(
6161
(acc, [permissionName, permissionValue]) => {
6262
///: BEGIN:ONLY_INCLUDE_IF(snaps)
6363
if (permissionName === RestrictedMethods.wallet_snap) {

0 commit comments

Comments
 (0)