question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ComponentDialog::BuildDialogState throws NullReferenceException

See original GitHub issue

Version

SDK 4.19 .NET 7

Describe the bug

BuildDialogState throws NullReferenceException (in line if (state.DialogStack == null) Dialog isn’t properly restored in line state = instance.State[PersistedDialogState] as DialogState;, although instance object is set properly, and State seems to be proper JObject. It looks like deserialization goes wrong. Issue appears only after upgrade to 4.19, on 4.18.1 no exception is thrown.

To Reproduce

In my bot:

  1. Conversation is initiated
  2. First dialogstack is built
  3. Response to user is sent.
  4. User sends message
  5. On rebuilding stack exception is thrown

Expected behavior

DialogState is properly rebuilt

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
anishprasad01commented, Feb 15, 2023

Fix merged, will be live in the next patch release.

1reaction
anishprasad01commented, Jan 20, 2023

Thank you both for that information. I will attempt to repro with Cosmos for state.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initialize Component throws a null reference exception
This works fine on my system but the Initialize Component throws a null reference exception when deployed on a colleagues system.
Read more >
[SOLVED] GetGomponent throws NullReferenceException ...
In the standalone build, GetComponent() returns null, has a little hissy fit and throws a NullReferenceException, and execution stops before it ...
Read more >
NullReferenceException when passing dialog name as ...
Describe the bug. When trying to start a dialog passing its name as a variable to Microsoft.BeginDialog , SDK throws a NullReferenceException ....
Read more >
Blazor HotReload throws `System.NullReferenceException ...
When using the serilog browser-console sink, the application throws System.NullReferenceException . The author of the library already tried ...
Read more >
media library - MediaManager throwing null error
It looks like you have a field ImageField imageItem but imageItem.MediaItem is null . It's either not selected or the media item is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found