Call to a member function getComponent() on null

Created on 26 November 2017, almost 7 years ago
Updated 19 December 2017, almost 7 years ago

On the URL /node/3/revisions/view/9/10/split_fields looking at a node with an image field I get the error:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getComponent() on null in Drupal\diff\Plugin\diff\Field\ImageFieldBuilder->build() (line 77 of modules/contrib/diff/src/Plugin/diff/Field/ImageFieldBuilder.php).
Drupal\diff\Plugin\diff\Field\ImageFieldBuilder->build(Object) (Line: 94)
Drupal\diff\DiffEntityParser->parseEntity(Object) (Line: 87)
Drupal\diff\DiffEntityParser->parseEntity(Object) (Line: 97)
Drupal\diff\DiffEntityComparison->compareRevisions(Object, Object) (Line: 115)
Drupal\diff\Plugin\diff\Layout\SplitFieldsDiffLayout->build(Object, Object, Object) (Line: 167)
Drupal\diff\Controller\PluginRevisionController->compareEntityRevisions(Object, Object, Object, 'split_fields') (Line: 49)
Drupal\diff\Controller\NodeRevisionController->compareNodeRevisions(Object, Object, Object, 'split_fields')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

The attached patch fixes the error.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom dahousecat

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024