Problem/Motivation
Errors occur (somewhat randomly) when using default content deploy with layout paragraphs.
[error] Error: Call to a member function uuid() on null in layout_paragraphs_paragraph_presave() (line 120 of /app/web/modules/contrib/layout_paragraphs/layout_paragraphs.module) #0 [internal function]: layout_paragraphs_paragraph_presave(Object(Drupal\paragraphs\Entity\Paragraph))
#1 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array('layout_paragrap...', Array)
Issue is that there is not a check if the paragraph still exists. Which could be a real use case (without default content deploy) if some situation occurs that a paragraph entity is deleted, while a (layout) paragraph still has a relation to it.
Steps to reproduce
Quite difficult. But I guess setting op a layout paragraph with some paragraph (3 of them or so), delete 2 of them programmatically, and save the left over one programmatically.
Proposed resolution
Simple check in the isset to verify that it is an object.
Issue fork layout_paragraphs-3195152
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jefuri commentedComment #5
justin2pin commentedGood catch, thanks @jefuri - this is merged.