Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle null message.Text in DateTimePrompt #3605

Closed
xieofxie opened this issue Mar 20, 2020 · 1 comment
Closed

Handle null message.Text in DateTimePrompt #3605

xieofxie opened this issue Mar 20, 2020 · 1 comment
Assignees
Labels
Area: Engineering Internal issues that are related to improving code quality, refactorings, code cleanup, etc. P1 Painful if we don't fix, won't block releasing R10 Release 10 - August 17th, 2020
Milestone

Comments

@xieofxie
Copy link
Contributor

Use this query to search for the most popular feature requests.

Is your feature request related to a problem? Please describe.
DateTimeRecognizer.RecognizeDateTime itself doesn't handle null query:

var results = DateTimeRecognizer.RecognizeDateTime(message.Text, culture, refTime: refTime);

It will throw

System.NullReferenceException: Object reference not set to an instance of an object.
  Stack Trace: 
    QueryProcessor.Preprocess(String query, Boolean caseSensitive, Boolean recode)
    DateTimeModel.Parse(String query, DateTime refTime)
    DateTimeRecognizer.RecognizeDateTime(String query, String culture, DateTimeOptions options, Nullable`1 refTime, Boolean fallbackToDefaultCulture)
    DateTimePrompt.OnRecognizeAsync(ITurnContext turnContext, IDictionary`2 state, PromptOptions options, CancellationToken cancellationToken) line 104

Describe the solution you'd like
Handle null in DateTimePrompt

Describe alternatives you've considered
Handle in DateTimeRecognizer.RecognizeDateTime

Additional context
Easily happen in DLS

[enhancement]

@mrivera-ms mrivera-ms changed the title handle null message.Text in DateTimePrompt Handle null message.Text in DateTimePrompt May 21, 2020
@mrivera-ms mrivera-ms added Area: Engineering Internal issues that are related to improving code quality, refactorings, code cleanup, etc. R10 Release 10 - August 17th, 2020 labels May 21, 2020
@axelsrz axelsrz added the P1 Painful if we don't fix, won't block releasing label Jun 15, 2020
@EricDahlvang
Copy link
Member

Looks like @mdrichardson has already completed this work: #3949

Thanks @mdrichardson !

@munozemilio munozemilio added this to the R10 milestone Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Engineering Internal issues that are related to improving code quality, refactorings, code cleanup, etc. P1 Painful if we don't fix, won't block releasing R10 Release 10 - August 17th, 2020
Projects
None yet
Development

No branches or pull requests

6 participants