Skip to content

Commit

Permalink
nit file handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Sep 4, 2024
1 parent e30c344 commit 3c988a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/lib/components/DisplayResult.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,16 @@
}
}
function contentOrRootString(obj: string | { filename: string; content: string }) {
function contentOrRootString(obj: string | { filename: string; content: string } | undefined) {
if (obj == undefined || obj == null) {
return ''
}
if (typeof obj === 'string') {
return obj
} else if (typeof obj === 'object') {
return obj?.['content']
} else {
return obj.content
return ''
}
}
Expand Down

0 comments on commit 3c988a5

Please sign in to comment.