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 Reference Exception >>>> Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar.UserMenuComponent #20768

Closed
1 task done
SeanHogg opened this issue Sep 8, 2024 · 7 comments

Comments

@SeanHogg
Copy link

SeanHogg commented Sep 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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.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>b__6_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>b__6_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>b__6_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>b__6_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

@SeanHogg SeanHogg added the bug label Sep 8, 2024
@realLiangshiwei
Copy link
Member

Reproduction Steps

@SeanHogg
Copy link
Author

.NET Blazor Server app.
Steps:
Register an account.
Then navigate to the root of the application.

@sturlath
Copy link
Contributor

Is this similar to #20616?

@SeanHogg
Copy link
Author

SeanHogg commented Sep 12, 2024 via email

@rumbledatingllc
Copy link

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.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>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
2024-09-12 10:27:40.314 -04:00 [ERR] Unhandled exception in circuit 'JcVZNcdDbUEqgmRuiMsFbpTWOszrFhoSIR7USN7uJrw'.
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>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
2024-09-12 10:27:40.322 -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.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>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
2024-09-12 10:27:40.322 -04:00 [ERR] Unhandled exception in circuit 'JcVZNcdDbUEqgmRuiMsFbpTWOszrFhoSIR7USN7uJrw'.
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>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
2024-09-12 10:27:40.430 -04:00 [DBG] Added 0 entity changes to the current audit log
2024-09-12 10:27:40.430 -04:00 [DBG] Added 0 entity changes to the current audit log
2024-09-12 10:27:40.430 -04:00 [DBG] Added 0 entity changes to the current audit log
2024-09-12 10:27:40.431 -04:00 [DBG] Setting the cache items. Count: 17
2024-09-12 10:27:40.431 -04:00 [DBG] Setting the cache items. Count: 17
2024-09-12 10:27:40.431 -04:00 [DBG] Setting the cache items. Count: 17
2024-09-12 10:27:40.433 -04:00 [DBG] Finished setting the cache items. Count: 17
2024-09-12 10:27:40.433 -04:00 [DBG] Finished setting the cache items. Count: 17
2024-09-12 10:27:40.433 -04:00 [DBG] Finished setting the cache items. Count: 17


@rumbledatingllc
Copy link

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
}

}

@realLiangshiwei
Copy link
Member

I can't reproduce the problem with latest version.

abp new BookStore -u blazor-server --tiered -t app --old

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

5 participants