title: Error: Call to a member function getTranslation() on null on paragraph deletion
body: <p>I want to delete the paragraphs from a field in a node; if the field has paragraphs in there or not. The below code throws the following error:</p>
  
  <p>Error: Call to a member function getTranslation() on null in Drupal\Core\Entity\ContentEntityBase->hasTranslationChanges() </p>
  
  <pre><code>    // delete all map_legend and map_item paragraphs before
      if (!empty($d8_node-&gt;field_map_legends-&gt;getValue())) {
          foreach ($d8_node-&gt;field_map_legends-&gt;getValue() as $paragraph) {
              if ($paragraph["target_id"]) {
                  $previous_paragraph = Paragraph::load($paragraph["target_id"]);
  
                  if ($previous_paragraph) {
                      $previous_paragraph-&gt;delete();
                  }
               }
          }
      }
  </code></pre>
  
  <p>When I comment out the $previous_paragraph->delete() it doesn't throw the error, but the paragraphs aren't deleted.</p>
  
  <p>I've tried try/catch around the delete. I've tried if isset on $previous_paragraph and on the field_map_legends itself. I've tried everything I can think of.</p>
  
  <p>I apologize if this is a duplicate somewhere else. Thanks for your help!</p>