Skip to content

Commit 729fcc4

Browse files
Merge pull request #4932 from xb058t/file-path-arrows
Remove the final arrow
2 parents 74d6d17 + 65f05a1 commit 729fcc4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

web/server/vue-cli/src/components/Report/ReportFilter/Filters/FilePathFilter.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
class="file-path-tree"
4646
>
4747
<template #prepend="{ item, isOpen }">
48-
<v-icon v-if="item.children.length > 0" size="small">
48+
<v-icon v-if="item.children?.length > 0" size="small">
4949
{{ isOpen ? 'mdi-folder-open' : 'mdi-folder' }}
5050
</v-icon>
5151
<v-icon v-else size="small">
@@ -173,13 +173,13 @@ const treeItems = computed(() => {
173173
} else {
174174
currentLevel.push({
175175
name: fileName, fullPath: filePath,
176-
children: [], findings: numCount
176+
findings: numCount
177177
});
178178
}
179179
}
180180
});
181181
function aggregate(node) {
182-
if (node.children.length === 0) return node.findings;
182+
if (!node.children?.length) return node.findings;
183183
node.findings = node.children.reduce(
184184
(sum, child) => sum + aggregate(child), 0
185185
);
@@ -275,8 +275,8 @@ function applyTreeSelection(onApplyFinished) {
275275
function isDirectory(fullPath) {
276276
const find = nodes => {
277277
for (const n of nodes) {
278-
if (n.fullPath === fullPath) return n.children.length > 0;
279-
if (n.children.length) {
278+
if (n.fullPath === fullPath) return (n.children?.length ?? 0) > 0;
279+
if (n.children?.length) {
280280
const r = find(n.children);
281281
if (r !== null) return r;
282282
}

0 commit comments

Comments
 (0)