Object reference not set to an instance of an object when looking at blog or profile #113

Open
opened 6 months ago by Ghost · 0 comments
Ghost commented 6 months ago

(sorry for Submit Bug Reporting so much but I'd like to see a real answer so I'm making an issue on the repo (and just noticed I didn't label this as a bug until after creation))

When looking at either my blog or profile, a 500 error occurs giving me a

large block of code (profile) ``` at AspNetCore.Areas_User_Views_User_ViewProfile.ExecuteAsync() in C:\Users\chris\Repositories\Teknik\Teknik\Areas\User\Views\User\ViewProfile.cshtml:line 150 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result) at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Teknik.WebCommon.Middleware.BlacklistMiddleware.Invoke(HttpContext context, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\BlacklistMiddleware.cs:line 84 at Teknik.WebCommon.Middleware.PerformanceMonitorMiddleware.Invoke(HttpContext httpContext, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\PerformanceMonitorMiddleware.cs:line 57 at Teknik.Middleware.ErrorHandlerMiddleware.Invoke(HttpContext httpContext, IErrorController errorController) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\ErrorHandlerMiddleware.cs:line 63 ```
large block of code (blog) ``` at Teknik.Areas.Blog.Controllers.BlogController.Blog(String username) in C:\Users\chris\Repositories\Teknik\Teknik\Areas\Blog\Controllers\BlogController.cs:line 84 at lambda_method1453(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Teknik.WebCommon.Middleware.BlacklistMiddleware.Invoke(HttpContext context, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\BlacklistMiddleware.cs:line 84 at Teknik.WebCommon.Middleware.PerformanceMonitorMiddleware.Invoke(HttpContext httpContext, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\PerformanceMonitorMiddleware.cs:line 57 at Teknik.Middleware.ErrorHandlerMiddleware.Invoke(HttpContext httpContext, IErrorController errorController) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\ErrorHandlerMiddleware.cs:line 63 ```
large block of code (blog settings) ``` at Teknik.Areas.Users.Controllers.UserController.BlogSettings() in C:\Users\chris\Repositories\Teknik\Teknik\Areas\User\Controllers\UserController.cs:line 570 at lambda_method2684(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Teknik.WebCommon.Middleware.BlacklistMiddleware.Invoke(HttpContext context, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\BlacklistMiddleware.cs:line 84 at Teknik.WebCommon.Middleware.PerformanceMonitorMiddleware.Invoke(HttpContext httpContext, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\PerformanceMonitorMiddleware.cs:line 57 at Teknik.Middleware.ErrorHandlerMiddleware.Invoke(HttpContext httpContext, IErrorController errorController) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\ErrorHandlerMiddleware.cs:line 63 ```

Importantly (I assume) the first line (file path) varies if I go to my profile page or blog. The same 'object reference...' reason is provided.

I'm not familiar with ASP.Net so I can't do much of my own bugfinding, but I think I might've removed some aspect of my user object? BlogSettings? That's likely completely wrong.

No idea how to reproduce this, I was just operating with blog articles and experimenting with their capability. I think it would be some issue with the blog functionality that had broken the profile view as well.

(sorry for Submit Bug Reporting so much but I'd like to see a real answer so I'm making an issue on the repo (and just noticed I didn't label this as a bug until after creation)) When looking at either my blog or profile, a 500 error occurs giving me a <details><summary>large block of code (profile)</summary> ``` at AspNetCore.Areas_User_Views_User_ViewProfile.ExecuteAsync() in C:\Users\chris\Repositories\Teknik\Teknik\Areas\User\Views\User\ViewProfile.cshtml:line 150 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result) at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Teknik.WebCommon.Middleware.BlacklistMiddleware.Invoke(HttpContext context, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\BlacklistMiddleware.cs:line 84 at Teknik.WebCommon.Middleware.PerformanceMonitorMiddleware.Invoke(HttpContext httpContext, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\PerformanceMonitorMiddleware.cs:line 57 at Teknik.Middleware.ErrorHandlerMiddleware.Invoke(HttpContext httpContext, IErrorController errorController) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\ErrorHandlerMiddleware.cs:line 63 ``` </details> <details><summary>large block of code (blog)</summary> ``` at Teknik.Areas.Blog.Controllers.BlogController.Blog(String username) in C:\Users\chris\Repositories\Teknik\Teknik\Areas\Blog\Controllers\BlogController.cs:line 84 at lambda_method1453(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Teknik.WebCommon.Middleware.BlacklistMiddleware.Invoke(HttpContext context, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\BlacklistMiddleware.cs:line 84 at Teknik.WebCommon.Middleware.PerformanceMonitorMiddleware.Invoke(HttpContext httpContext, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\PerformanceMonitorMiddleware.cs:line 57 at Teknik.Middleware.ErrorHandlerMiddleware.Invoke(HttpContext httpContext, IErrorController errorController) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\ErrorHandlerMiddleware.cs:line 63 ``` </details> <details><summary>large block of code (blog settings)</summary> ``` at Teknik.Areas.Users.Controllers.UserController.BlogSettings() in C:\Users\chris\Repositories\Teknik\Teknik\Areas\User\Controllers\UserController.cs:line 570 at lambda_method2684(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Teknik.WebCommon.Middleware.BlacklistMiddleware.Invoke(HttpContext context, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\BlacklistMiddleware.cs:line 84 at Teknik.WebCommon.Middleware.PerformanceMonitorMiddleware.Invoke(HttpContext httpContext, Config config) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\PerformanceMonitorMiddleware.cs:line 57 at Teknik.Middleware.ErrorHandlerMiddleware.Invoke(HttpContext httpContext, IErrorController errorController) in C:\Users\chris\Repositories\Teknik\WebCommon\Middleware\ErrorHandlerMiddleware.cs:line 63 ``` </details> Importantly (I assume) the first line (file path) varies if I go to my profile page or blog. The same 'object reference...' reason is provided. I'm not familiar with ASP.Net so I can't do much of my own bugfinding, but I think I might've removed some aspect of my user object? BlogSettings? That's likely completely wrong. No idea how to reproduce this, I was just operating with blog articles and experimenting with their capability. I think it would be some issue with the blog functionality that had broken the profile view as well.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.