-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 in the Admin theme #15752
Comments
Shouldn't we rather throw a custom exception (not an ad-hoc NRE) if |
I'm not sure why, but the menu item with the issue is "Azure Blob Options." Throwing an exception will prevent the theme from rendering, making the admin inaccessible. |
I can't reproduce this with the latest |
Don't you have any other custom code in the solution that could affect this though? Because that link specifies a What I can imagine is that perhaps you have a custom |
Can you please expand these two nodes? I am looking for more clues on what created this menu item. |
The issue was that the Admin controller was not registering, so no action URL was being generated. I was able to fix it by disabling and reenabling the module. You should still check for null. The entire admin module was inaccessible. At least, it should render an error for the user. Thanks for the help! |
Maybe there is a dependency issue. Which admin controller was not available? or which feature you enabled to fix the issue? |
We are missing something here. I am wondering if you were registering the AdminMenu class in your project somehow
This class what added the menu item which appears to be that caused your issue. That class would not be registered unless the Based on your explanation, it seems that that AdminMenu was registered while the feature was not which does not make sense "at least from what I can see in OC code". |
We don't have an INavigationProvider that's adding the menu item. I looked everywhere for it. Could it be security? When I disabled and reenabled the module, the claims were added to my identity. |
I am not sure. Try disabling the feature that fixed your issue and see if you can do some tracing to see what is actually adding that menu item. Maybe look at the logs to see if there are any additional clues |
While upgrading our website from 1.6 to 1.82, we ran into an issue with the Admin theme. Line 12 in NavigationItemLink-admin.cshtml is not checking for null, which prevents the theme from rendering.
Original:
if (Model.Href.ToString() == "#")
Changed to:
if ( ( Model.Href?.ToString() ?? "#" ) == "#")
Thanks
The text was updated successfully, but these errors were encountered: