diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2025-11-03 13:30:26 -0400 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2025-11-03 13:30:26 -0400 |
| commit | 75665f99697bb1cb77d89b9fceffdeb8299080d8 (patch) | |
| tree | 3f567560dba777b708daa10f038359b246620939 /src | |
| parent | f5fbe3a6ad5c2ef411a6f1594f0a9c9f6659fd2d (diff) | |
client, search: fix bad Object.hasOwn() accesses
Diffstat (limited to 'src')
| -rw-r--r-- | src/search-select.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/search-select.js b/src/search-select.js index 24532cbb..44132ca0 100644 --- a/src/search-select.js +++ b/src/search-select.js @@ -169,22 +169,19 @@ function genericProcess(thing, opts) { const contributions = contribKeys - .filter(key => Object.hasOwn(thing, key)) - .flatMap(key => thing[key]); + .flatMap(key => thing[key] ?? []); fields.contributors = contributions .flatMap(({artist}) => [ artist.name, - ...artist.aliasNames, + ...artist.artistAliases.map(alias => alias.name), ]); const groups = - (Object.hasOwn(thing, 'groups') - ? thing.groups - : Object.hasOwn(thing, 'album') - ? thing.album.groups - : []); + thing.groups ?? + thing.album?.groups ?? + []; const mainContributorNames = contributions |