From c43924f568e6098bdb583d33952a3095ee453569 Mon Sep 17 00:00:00 2001 From: Beno!t POLASZEK Date: Fri, 7 Jul 2023 22:56:31 +0200 Subject: [PATCH] feat: fallback to undefined --- lib/ts/lib.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ts/lib.ts b/lib/ts/lib.ts index b4a51bf..d45602d 100644 --- a/lib/ts/lib.ts +++ b/lib/ts/lib.ts @@ -15,9 +15,9 @@ export const dialogRef = shallowRef(); * Closes the currently opened dialog, resolving the promise with the return value of the dialog, or with the given * data if any. */ -export function closeDialog(data?: any) { +export function closeDialog(data?: any): void { if (data === undefined) { - data = dialogRef.value.comp.returnValue(); + data = 'function' === typeof dialogRef.value.comp.returnValue ? dialogRef.value.comp.returnValue() : undefined; } dialogRef.value.resolve(data); dialogRef.value = null;