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

* Fix crash when uninstalling snap

* Run lint
feature/default_network_editable
Frederik Bolding 2 years ago committed by GitHub
parent ea947ed1a4
commit 6cd18ea62b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ui/pages/settings/flask/view-snap/view-snap.js

@ -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">

Loading…
Cancel
Save