Skip to content

Commit 0202dd6

Browse files
committed
safer status
1 parent ee1606d commit 0202dd6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/src/models/status.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ function getSketchFileParts(path: string, sketchFile?: IKactusFile) {
138138
if (!sketchFile) {
139139
return []
140140
}
141-
const parts = path.split(sketchFile.id + '/')[1].split('/')
141+
const secondPart = path.split(sketchFile.id + '/')[1]
142+
if (!secondPart) {
143+
return [sketchFile.id]
144+
}
145+
const parts = secondPart.split('/')
142146
return [sketchFile.id].concat(parts.slice(0, parts.length - 1))
143147
}
144148

0 commit comments

Comments
 (0)