Skip to content

Commit

Permalink
fix(encryption): handle empty encryptionModules fine
Browse files Browse the repository at this point in the history
`[].find(...)` will return `undefined`.
`undefined[0]` throws an exception.
Handle this case more gracefully.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud authored and backportbot[bot] committed Jan 20, 2025
1 parent f67a555 commit d48ce5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/settings/src/components/Encryption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default {
encryptionModules,
shouldDisplayWarning: false,
migrating: false,
defaultCheckedModule: Object.entries(encryptionModules).find((module) => module[1].default)[0],
defaultCheckedModule: Object.entries(encryptionModules).find((module) => module[1].default)?.[0],
}
},
computed: {
Expand Down

0 comments on commit d48ce5b

Please sign in to comment.