1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

[FLASK] Fix crash when uninstalling snap (#15799)

* Fix crash when uninstalling snap

* Run lint
This commit is contained in:
Frederik Bolding 2022-09-13 12:41:29 +02:00 committed by seaona
parent b16606156f
commit 8226322244

View File

@ -54,7 +54,9 @@ function ViewSnap() {
const connectedSubjects = useSelector((state) =>
getSubjectsWithPermission(state, snap?.permissionName),
);
const permissions = useSelector((state) => getPermissions(state, snap?.id));
const permissions = useSelector(
(state) => snap && getPermissions(state, snap.id),
);
const dispatch = useDispatch();
const onDisconnect = (connectedOrigin, snapPermissionName) => {
dispatch(
@ -142,7 +144,9 @@ function ViewSnap() {
{t('snapAccess', [snap.manifest.proposedName])}
</Typography>
<Box width={FRACTIONS.TEN_TWELFTHS}>
<PermissionsConnectPermissionList permissions={permissions} />
<PermissionsConnectPermissionList
permissions={permissions ?? {}}
/>
</Box>
</div>
<div className="view-snap__section">