From 3465f12f1defd9fcca4ce042eef8a914ce74e8d2 Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Tue, 9 Aug 2022 15:57:36 +0800 Subject: [PATCH] Add auser friendly message to avoid throwing recovery screen feature/prompt-error-support File List: src/ui/React/PromptManager.tsx --- src/ui/React/PromptManager.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/React/PromptManager.tsx b/src/ui/React/PromptManager.tsx index de16b38a4..66b83522e 100644 --- a/src/ui/React/PromptManager.tsx +++ b/src/ui/React/PromptManager.tsx @@ -139,6 +139,10 @@ function PromptMenuSelect({ prompt, resolve }: IContentProps): React.ReactElemen return content; }; + if (!Array.isArray(prompt?.options?.choices)) { + return Error: Please provide an array of string choices; + } + return ( <>