Skip to content

Commit ca90dbb

Browse files
authored
fix(file): crash eig when empty file 1153 (#993)
## Ticket(s) lié(s) 1153 ## Description Correction du crash du render lorqu'il n'y a pas de fichier à afficher
2 parents 4b3da8e + a66e75c commit ca90dbb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/shared/src/components/FileUpload.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ const headers = [
4848
];
4949
const file = defineModel({ type: Object });
5050
const rows = computed(() => {
51-
if (file.value) {
51+
if (file.value && Object.keys(file.value).length > 0) {
5252
const name = file.value.name;
53-
const extension = name.split(".").pop()?.toLowerCase() || "-";
53+
const extension = name?.split(".").pop()?.toLowerCase() || "-";
5454
const type = extension;
5555
const createdAt = file.value.createdAt
5656
? dayjs(file.value.createdAt).format("YYYY-MM-DD HH:mm")

0 commit comments

Comments
 (0)