diff --git a/skills/csharp/experimental/weatherskill/Dialogs/ForecastDialog.cs b/skills/csharp/experimental/weatherskill/Dialogs/ForecastDialog.cs index 47638be594..1fd7fd9cb0 100644 --- a/skills/csharp/experimental/weatherskill/Dialogs/ForecastDialog.cs +++ b/skills/csharp/experimental/weatherskill/Dialogs/ForecastDialog.cs @@ -66,7 +66,7 @@ private async Task 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(); } @@ -122,7 +122,7 @@ private async Task 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); } diff --git a/skills/csharp/experimental/weatherskill/Models/SkillState.cs b/skills/csharp/experimental/weatherskill/Models/SkillState.cs index f3e727f332..6fd4ea5997 100644 --- a/skills/csharp/experimental/weatherskill/Models/SkillState.cs +++ b/skills/csharp/experimental/weatherskill/Models/SkillState.cs @@ -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; }