diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index 46ddd90..30b306f 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -402,7 +402,11 @@ function entity_test_entity_test_insert($entity) { * Implements hook_entity_update(). */ function entity_test_entity_update(EntityInterface $entity) { - \Drupal::state()->set('entity_test.previous', $entity->previous); + $previous = null; + if (isset($entity->previous)) { + $previous = $entity->previous; + } + \Drupal::state()->set('entity_test.previous', $previous); } /**