NullReferenceException in TransformBlocks
See original GitHub issueAfter upgrading my setup using PostgreSQL from 8.3 (latest packages) to 8.4 I get the following exceptions:
When opening a page in the manager:
System.NullReferenceException: Object reference not set to an instance of an object.
at Piranha.Services.ContentService`3.TransformBlocks(IEnumerable`1 blocks)
at Piranha.Repositories.PageRepository.ProcessAsync[T](Page page, T model)
at Piranha.Services.ContentService`3.TransformAsync[T](TContent content, ContentTypeBase type, Func`3 process)
at Piranha.Repositories.PageRepository.GetById[T](Guid id)
at Piranha.Services.PageService.GetByIdAsync[T](Guid id)
at Piranha.Manager.Services.PageService.GetById(Guid id, Boolean useDraft)
at Piranha.Manager.Controllers.PageApiController.Get(Guid id)
at lambda_method(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
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__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
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 Piranha.AspNetCore.SitemapMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
at Piranha.AspNetCore.IntegratedMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
at Piranha.AspNetCore.Security.SecurityMiddleware.InvokeAsync(HttpContext ctx, IApplicationService service)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
When opening the same page from the frontend
System.NullReferenceException: Object reference not set to an instance of an object.
at Piranha.Services.ContentService`3.TransformBlocks(IEnumerable`1 blocks)
at Piranha.Repositories.PageRepository.ProcessAsync[T](Page page, T model)
at Piranha.Services.ContentService`3.TransformAsync[T](TContent content, ContentTypeBase type, Func`3 process)
at Piranha.Repositories.PageRepository.GetStartpage[T](Guid siteId)
at Piranha.Services.PageService.GetStartpageAsync[T](Nullable`1 siteId)
at Piranha.AspNetCore.IntegratedMiddleware.Invoke(HttpContext context, IApi api, IApplicationService service)
at Piranha.AspNetCore.Security.SecurityMiddleware.InvokeAsync(HttpContext ctx, IApplicationService service)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Catching the original exception with TransformBlock
I am using the TransformBlock from the TPL Dataflow library, and I have realized that when a exception is thrown during the transform, ......
Read more >Exception Handling in TPL Dataflow Networks
The Exception will be available from the block's Completion Task's Exception property, and it can be handled as in TPL model. Note, as...
Read more >C# Language Tutorial => TransformManyBlock<TInput, ...
As with ActionBlock and TransformBlock<TInput, TOutput>, this processing may be specified using delegates, both for synchronous and asynchronous processing. A ...
Read more >C# Language Tutorial => TransformBlock<TInput, TOutput>
It has 2 tasks: One to process the data, and one to push data to the next block. enter image description here. A...
Read more >C# | Task Parallel Library (TPL) Dataflow Constructs
As with ActionBlock and TransformBlock<TInput, TOutput>, this processing may be specified using delegates, both for synchronous and asynchronous processing. A ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mikaellindemann @honzajscz Thanks for the quick feedback on the issue!
Version
8.4.1
ofPiranha
is now available onNuGet