diff --git a/plugins/baser-core/src/Model/Table/SitesTable.php b/plugins/baser-core/src/Model/Table/SitesTable.php index c7624fb76e..341a788010 100644 --- a/plugins/baser-core/src/Model/Table/SitesTable.php +++ b/plugins/baser-core/src/Model/Table/SitesTable.php @@ -743,7 +743,7 @@ public function save(EntityInterface $entity, $options = []) if($request) { $session = Router::getRequest()->getSession(); $currentSite = $session->read('BcApp.Admin.currentSite'); - if ($success->id === $currentSite->id) { + if ($currentSite && $success->id === $currentSite->id) { $session->write('BcApp.Admin.currentSite', $success); } }