diff --git a/addtoany.install b/addtoany.install index 7d1c94c57ec74bfe9c4f45d8c097ecf9d177f17a..a9fd36f05a2b15e9ca271a98da3914e737e78bf7 100644 --- a/addtoany.install +++ b/addtoany.install @@ -27,7 +27,9 @@ function addtoany_install() { // Get the config entity for this bundle and view mode. $display = $storage->load('node.' . $bundle . '.' . $viewmode); // Enable the AddToAny extra field and save the config. - $display->setComponent('addtoany', ['weight' => $display_weight])->save(); + if (!empty($display)) { + $display->setComponent('addtoany', ['weight' => $display_weight])->save(); + } } } }