question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReferenceException in TransformBlocks

See original GitHub issue

After 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:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tidyuicommented, Aug 19, 2020

@mikaellindemann @honzajscz Thanks for the quick feedback on the issue!

1reaction
tidyuicommented, Aug 19, 2020

Version 8.4.1 of Piranha is now available on NuGet

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found