Skip to content

Commit a3746ad

Browse files
Add console error if kind is missing from contentNode
1 parent 83a5c0a commit a3746ad

File tree

1 file changed

+6
-4
lines changed
  • contentcuration/contentcuration/frontend/channelEdit/components/Clipboard

1 file changed

+6
-4
lines changed

contentcuration/contentcuration/frontend/channelEdit/components/Clipboard/index.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,19 @@
252252
const contentNodesValues = Object.values(this.contentNodesMap);
253253
this.selectedNodeIds.forEach(id => {
254254
const node = this.clipboardNodesMap[id];
255-
let kind = node?.kind;
255+
let kind = node.kind;
256256
// Check contentNodesMap for node kind if missing in clipboardNodesMap
257-
if (!kind && node?.source_node_id) {
257+
if (!kind && node.source_node_id) {
258258
const contentNode = contentNodesValues.find(n => n.node_id === node.source_node_id);
259-
kind = contentNode?.kind;
259+
kind = contentNode.kind;
260260
}
261261
262262
if (kind === 'topic') {
263263
topicCount++;
264-
} else {
264+
} else if (kind) {
265265
resourceCount++;
266+
} else {
267+
console.error('`kind` missing from content.');
266268
}
267269
});
268270
return { topicCount: topicCount, resourceCount: resourceCount };

0 commit comments

Comments
 (0)