diff --git a/libraries/AdaptiveExpressions/ExpressionProperties/ExpressionProperty.cs b/libraries/AdaptiveExpressions/ExpressionProperties/ExpressionProperty.cs index 3ae3599b9a..87f1485639 100644 --- a/libraries/AdaptiveExpressions/ExpressionProperties/ExpressionProperty.cs +++ b/libraries/AdaptiveExpressions/ExpressionProperties/ExpressionProperty.cs @@ -120,9 +120,17 @@ public virtual Expression ToExpression() /// /// data to use for expression binding. /// Value or default(T) if not found. + /// An error will be thrown if data is an invalid expression. public virtual T GetValue(object data) { - return this.TryGetValue(data).Value; + var (value, error) = TryGetValue(data); + + if (error != null) + { + throw new ArgumentException(error); + } + + return value; } /// diff --git a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/ConfirmInput.cs b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/ConfirmInput.cs index 1d2530ce04..ce5058d913 100644 --- a/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/ConfirmInput.cs +++ b/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/ConfirmInput.cs @@ -131,7 +131,8 @@ protected async override Task OnRecognizeInputAsync(DialogContext dc { // First check whether the prompt was sent to the user with numbers - if it was we should recognize numbers var defaults = DefaultChoiceOptions[culture]; - var choiceOptions = ChoiceOptions?.GetValue(dc.State) ?? defaults.Item3; + var opts = await GetChoiceOptionsAsync(dc, defaults).ConfigureAwait(false); + var choiceOptions = opts ?? defaults.Item3; // This logic reflects the fact that IncludeNumbers is nullable and True is the default set in Inline style if (!choiceOptions.IncludeNumbers.HasValue || choiceOptions.IncludeNumbers.Value)