Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
fix parse number exception (#2381)
Browse files Browse the repository at this point in the history
  • Loading branch information
KayMKM authored Sep 20, 2019
1 parent 37e0091 commit 47643ef
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -780,14 +780,18 @@ protected async Task DigestCalendarLuisResult(DialogContext dc, CalendarLuis lui
if (generalLuisResult.Entities.ordinal != null)
{
var value = generalLuisResult.Entities.ordinal[0];
var num = int.Parse(value.ToString());
state.ShowMeetingInfor.UserSelectIndex = num - 1;
if (int.TryParse(value.ToString(), out var num))
{
state.ShowMeetingInfor.UserSelectIndex = num - 1;
}
}
else if (generalLuisResult.Entities.number != null)
{
var value = generalLuisResult.Entities.number[0];
var num = int.Parse(value.ToString());
state.ShowMeetingInfor.UserSelectIndex = num - 1;
if (int.TryParse(value.ToString(), out var num))
{
state.ShowMeetingInfor.UserSelectIndex = num - 1;
}
}

if (!isBeginDialog)
Expand Down

0 comments on commit 47643ef

Please sign in to comment.