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

Null Refrence When Disposing Object #80

Closed
TheLazyLemur opened this issue Aug 18, 2020 · 1 comment
Closed

Null Refrence When Disposing Object #80

TheLazyLemur opened this issue Aug 18, 2020 · 1 comment

Comments

@TheLazyLemur
Copy link

Version Of Blazor

  • Blazor Server

Issue

I am currently having an issue when I try go to another route. The issue occurs weather I use an "a" tag or the navigation manager built into Blazor.
When I route I get the error :

[2020-08-18T12:48:27.447Z] Error: System.AggregateException: Exceptions were encountered while disposing components. (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose(Boolean disposing)
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)
   --- End of inner exception stack trace ---
 ---> (Inner Exception #1) System.NullReferenceException: Object reference not set to an instance of an object.
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose(Boolean disposing)
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)<---

 ---> (Inner Exception #2) System.NullReferenceException: Object reference not set to an instance of an object.
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose(Boolean disposing)
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)<---

 ---> (Inner Exception #3) System.NullReferenceException: Object reference not set to an instance of an object.
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose(Boolean disposing)
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)<---

if i try to manually override dispose I get a null refrence where base.Dispose(disposed); is called:

 (Inner Exception #2) System.NullReferenceException: Object reference not set to an instance of an object.
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose(Boolean disposing)
   at EdenXRPlatform.Components.Reporting.Dashboard.Charts.Engagement.Dispose(Boolean disposed) in /home/dan/Workspace/Eden/XRPlatform/EdenXRPlatform/Components/Reporting/Dashboard/Charts/Engagement.razor.cs:line 32
   at Fluxor.Blazor.Web.Components.FluxorComponent.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)<---
@TheLazyLemur
Copy link
Author

TheLazyLemur commented Aug 18, 2020

Solution

I just had not called base.OnInitialized(); in the components OnInitialized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant