Skip to content

Commit fe265f8

Browse files
committed
fix: checking metadata roles crash
1 parent 6c6de56 commit fe265f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/custom/cappasity-postprocess.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = function extractMetadata(data) {
1717
.publishAndWait(getMetadata, { username, audience })
1818
.get(audience)
1919
.then(metadata => {
20-
if (metadata.roles.indexOf('admin') >= 0) {
20+
if (metadata.roles && metadata.roles.indexOf('admin') >= 0) {
2121
return null;
2222
}
2323

0 commit comments

Comments
 (0)