diff --git a/modules/contrib/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php b/modules/contrib/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php
index 61e94130f..ff800ef3e 100644
--- a/modules/contrib/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php
+++ b/modules/contrib/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php
@@ -135,11 +135,15 @@ public function normalize($field, $format = NULL, array $context = []) {
       // Get the referenced entity.
       $entity = $item->get('entity')->getValue();
 
-      if ($this->isInternalResourceType($entity)) {
+      if (!is_null($entity)) {
+        if ($this->isInternalResourceType($entity)) {
+            continue;
+        }
+      } else {
         continue;
       }
 
       // And get the translation in the requested language.
       $entity_list[] = $this->entityRepository->getTranslationFromContext($entity);
     }
     $entity_collection = new EntityCollection($entity_list);