Closed SeanHogg closed 3 weeks ago
Reproduction Steps
.NET Blazor Server app. Steps: Register an account. Then navigate to the root of the application.
Is this similar to https://github.com/abpframework/abp/issues/20616?
No they are different components.
Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.UserMenuComponent
If someone can point me to the source code I can probably determine the exact line of code.
It happens after authentication and the redirect. I think it's a ICurrentUser check and it's null.
---- On Thu, 12 Sep 2024 05:15:17 -0400 @.*** wrote ----
Is this similar to #20616?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
2024-09-12 10:27:39.022 -04:00 [DBG] Getting all granted permissions from the repository for this provider name,key: U,3a14e5b0-5417-3912-d5e1-d4dde03e6b6b
2024-09-12 10:27:40.307 -04:00 [WRN] Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.MobileUserMenuComponent.
For those experiencing the error the work around is to create a class that inherits from the MobileUserMenuComponent and to override the SetParametersAsync
using Microsoft.AspNetCore.Components; using Volo.Abp.DependencyInjection; using MobileUserMenuComponent = Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.MobileUserMenuComponent;
namespace YourDotNet8Namespace;
[ExposeServices(typeof(MobileUserMenuComponent))] [Dependency(ReplaceServices = true)] public partial class OverrideMobileUserMenuComponent : MobileUserMenuComponent { public string Name = "My Mobile User Menu Component";
public override async Task SetParametersAsync(ParameterView parameters)
{
//await base.SetParametersAsync(parameters); //<================ GARBAGE HACK
}
}
I can't reproduce the problem with latest version.
abp new BookStore -u blazor-server --tiered -t app --old
Is there an existing issue for this?
Description
When initializing the application a null reference exception is thrown
[09:50:59 WRN] Unhandled exception rendering component: Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.MobileUserMenuComponent.b36_2(RenderTreeBuilder builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
[09:50:59 ERR] Unhandled exception in circuit 'xesp37VYPTTflk9xo_FTL4U9Hm6y7UelAW3TV5ztOvs'.
System.NullReferenceException: Object reference not set to an instance of an object.
at Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.MobileUserMenuComponent.b__36_2(RenderTreeBuilder builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
[09:50:59 WRN] Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.UserMenuComponent.b__52_2(RenderTreeBuilder builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
[09:50:59 ERR] Unhandled exception in circuit 'xesp37VYPTTflk9xo_FTL4U9Hm6y7UelAW3TV5ztOvs'.
System.NullReferenceException: Object reference not set to an instance of an object.
at Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.UserMenuComponent.b 52_2(RenderTreeBuilder builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
Reproduction Steps
No response
Expected behavior
No response
Actual behavior
No response
Regression?
No response
Known Workarounds
No response
Version
8.2.2
User Interface
Blazor Server
Database Provider
EF Core (Default)
Tiered or separate authentication server
Tiered
Operation System
Windows (Default)
Other information
No response