alexa-skills-dotnet: One or more errors occurred. (Object reference not set to an instance of an object.): AggregateException at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotificatio

Line 42: string countryRequested = intentRequest?.Intent?.Slots[“Country”].Value;

One or more errors occurred. (Object reference not set to an instance of an object.): AggregateException at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at lambda_method(Closure , Stream , Stream , LambdaContextInternal )

at LambdaAlexa.Function.FunctionHandler(SkillRequest input, ILambdaContext context) in D:\vcprojects\LambdaAlexa\LambdaAlexa\Function.cs:line 42 One or more errors occurred. (Object reference not set to an instance of an object.): AggregateException at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at lambda_method(Closure , Stream , Stream , LambdaContextInternal )

at LambdaAlexa.Function.FunctionHandler(SkillRequest input, ILambdaContext context) in D:\vcprojects\LambdaAlexa\LambdaAlexa\Function.cs:line 42

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Okay so @ourweb4 - can you please delete that message, those tokens are live and will allow people to act as your skill.

What you can see though is that you’re getting AMAZON.FallbackIntent - which is what you receive when what the user has says doesn’t match any of your intents. So there are no slots, which mean your code will break if it assumes the slot value exists.

What you need is to ensure you only run your code when it’s your Country intent that’s been invoked. Something like if(intentRequest.Intent.Name == 'Country') or whatever works for your skill

Hope this helps