Skip to content

Commit

Permalink
🥅 Guard invalid tags in iscn-ar
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Mar 22, 2022
1 parent e0f65b7 commit f9fedd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pages/in/widget/iscn-ar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ export default {
async onReceiveISCNData(data) {
const {
fingerprints = [],
tags = [],
url,
publisher,
author,
Expand All @@ -485,6 +484,7 @@ export default {
license,
type,
name,
tags = [],
} = data;
type = type || 'article';
if (publisher) {
Expand All @@ -503,6 +503,12 @@ export default {
if (name) {
name = name.substring(0, 255);
}
if (!tags) {
tags = [];
} else if (typeof tags === 'string') {
tags = tags.split(',');
}

const ISCNData = {
fingerprints,
name,
Expand Down

0 comments on commit f9fedd2

Please # to comment.