Commit 87b85122 authored by gbyte.co's avatar gbyte.co

Issue #3078910 by lobodacyril, gbyte.co: Error: Call to a member function set() on null

parent 17a26cda
......@@ -120,7 +120,7 @@ class EntityMenuLinkContentUrlGenerator extends EntityUrlGeneratorBase {
/**
* @inheritdoc
*
* @todo Check if menu link has not been deleted after the queue has been built.
* @todo Find a way to be able to check if a menu link still exists. This is difficult as we don't operate on MenuLinkContent entities, but on Link entities directly (as some menu links are not MenuLinkContent entities).
*/
protected function processDataSet($data_set) {
......
......@@ -642,7 +642,10 @@ class Simplesitemap {
return $this;
}
$entity = $this->entityTypeManager->getStorage($entity_type_id)->load($id);
if (empty($entity = $this->entityTypeManager->getStorage($entity_type_id)->load($id))) {
// todo exception
return $this;
}
$all_bundle_settings = $this->getBundleSettings(
$entity_type_id, $this->entityHelper->getEntityInstanceBundleName($entity), TRUE, TRUE
......@@ -721,11 +724,13 @@ class Simplesitemap {
return unserialize($results);
}
else {
if (empty($entity = $this->entityTypeManager->getStorage($entity_type_id)->load($id))) {
return FALSE;
}
return $this->getBundleSettings(
$entity_type_id,
$this->entityHelper->getEntityInstanceBundleName(
$this->entityTypeManager->getStorage($entity_type_id)->load($id)
)
$this->entityHelper->getEntityInstanceBundleName($entity)
);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment