diff --git a/modules/lupus_decoupled_views/src/Plugin/views/style/CustomElements.php b/modules/lupus_decoupled_views/src/Plugin/views/style/CustomElements.php
index 7351dd3..b2e2bed 100644
--- a/modules/lupus_decoupled_views/src/Plugin/views/style/CustomElements.php
+++ b/modules/lupus_decoupled_views/src/Plugin/views/style/CustomElements.php
@@ -83,6 +83,10 @@ class CustomElements extends StylePluginBase {
         }
       }
       else {
+        // Skip rows where the entity could not be loaded.
+        if (!$row->_entity) {
+          continue;
+        }
         $custom_element = $this->getCustomElementGenerator()->generate($row->_entity, $this->view->rowPlugin->options['view_mode'] ?? $this->getViewMode($row->_entity->getEntityTypeId(), $row->_entity->bundle()));
       }
       // Use toRenderArray() to respect the render variant configuration.
