diff --git a/modules/paragraphs_demo/src/Tests/ParagraphsDemoTest.php b/modules/paragraphs_demo/src/Tests/ParagraphsDemoTest.php
index 54fc725..1543f28 100644
--- a/modules/paragraphs_demo/src/Tests/ParagraphsDemoTest.php
+++ b/modules/paragraphs_demo/src/Tests/ParagraphsDemoTest.php
@@ -155,4 +155,30 @@ class ParagraphsDemoTest extends WebTestBase {
     $this->assertNoRaw('Welcome to the Paragraphs Demo module!');
   }
 
+  /**
+   * Tests the nested paragraph.
+   */
+  public function testNestedParagraph() {
+    $this->drupalLogin($this->drupalCreateUser([
+      'create paragraphed_content_demo content',
+      'edit any paragraphed_content_demo content',
+    ]));
+    // Create an user the reference in a paragraph.
+    $test_user = $this->drupalCreateUser([]);
+
+    $this->drupalGet('node/add/paragraphed_content_demo');
+    $this->drupalPostForm(NULL, NULL, t('Add Nested Paragraph'));
+    $this->drupalPostAjaxForm(NULL, NULL, t('field_paragraphs_demo_0_subform_field_paragraphs_demo_user_add_more'));
+    $this->drupalPostForm(NULL, [
+      'title[0][value]' => 'Node title',
+      'field_paragraphs_demo[0][subform][field_paragraphs_demo][0][subform][field_user_demo][0][target_id]' => $test_user->label() . ' (' . $test_user->id() . ')',
+    ], t('Save'));
+
+    $test_user->delete();
+    $nodes = \Drupal::entityTypeManager()->getStorage('node')->loadByProperties(['title' => 'Node title']);
+    $this->drupalGet('node/' . current($nodes)->id() . '/edit');
+    $this->drupalPostAjaxForm(NULL, [], t('field_paragraphs_demo_0_collapse'));
+    $this->assertResponse(200);
+  }
+
 }
diff --git a/src/Plugin/Field/FieldWidget/ParagraphsWidget.php b/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
index 07acd5a..6ecbc65 100644
--- a/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
+++ b/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
@@ -1467,7 +1467,9 @@ class ParagraphsWidget extends WidgetBase {
       }
       if ($field_type = $value->getType() == 'entity_reference') {
         if (!in_array($key, ['type', 'uid', 'revision_uid'])) {
-          $summary[] = $paragraphs_entity->get($key)->entity->label();
+          if ($paragraphs_entity->get($key)->entity) {
+            $summary[] = $paragraphs_entity->get($key)->entity->label();
+          }
         }
       }
     }
