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

Commit

Permalink
[Weather] use IsNaN instead of comparison (#2588)
Browse files Browse the repository at this point in the history
  • Loading branch information
xieofxie authored and bobokids committed Oct 25, 2019
1 parent f12a7c2 commit b27a524
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private async Task<DialogTurnResult> RouteToGeographyPromptOrForecastResponse(Wa
var state = await _stateAccessor.GetAsync(stepContext.Context);
var geography = state.Geography;

if (string.IsNullOrEmpty(geography) && state.Latitude == double.NaN)
if (string.IsNullOrEmpty(geography) && double.IsNaN(state.Latitude))
{
return await stepContext.NextAsync();
}
Expand Down Expand Up @@ -122,7 +122,7 @@ private async Task<DialogTurnResult> GetWeatherResponse(WaterfallStepContext ste
{
state.GeographyLocation = await service.GetLocationByQueryAsync(state.Geography);
}
else if (state.Latitude != double.NaN)
else if (!double.IsNaN(state.Latitude))
{
state.GeographyLocation = await service.GetLocationByGeoAsync(state.Latitude, state.Longitude);
}
Expand Down
5 changes: 5 additions & 0 deletions skills/csharp/experimental/weatherskill/Models/SkillState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ namespace WeatherSkill.Models
{
public class SkillState
{
public SkillState()
{
Clear();
}

public string Token { get; internal set; }

public WeatherSkillLuis LuisResult { get; internal set; }
Expand Down

0 comments on commit b27a524

Please sign in to comment.