From 5f3640c7fd88a98d3c278e17d4bd91b836962395 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Sun, 5 Feb 2023 20:29:10 +0900
Subject: fix(client): validate input response in aiscript

---
 packages/frontend/src/widgets/WidgetButton.vue | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'packages/frontend/src/widgets/WidgetButton.vue')

diff --git a/packages/frontend/src/widgets/WidgetButton.vue b/packages/frontend/src/widgets/WidgetButton.vue
index 63e8e485e1..6c2c366aa2 100644
--- a/packages/frontend/src/widgets/WidgetButton.vue
+++ b/packages/frontend/src/widgets/WidgetButton.vue
@@ -60,7 +60,11 @@ const run = async () => {
 				os.inputText({
 					title: q,
 				}).then(({ canceled, result: a }) => {
-					ok(a);
+					if (canceled) {
+						ok('');
+					} else {
+						ok(a);
+					}
 				});
 			});
 		},
-- 
cgit v1.2.3-freya

