added another null check to contextual menu
This commit is contained in:
parent
b5f567f872
commit
d2bd27c960
@ -101,10 +101,13 @@ class ContextualMenu extends BlockBase {
|
|||||||
private function casePage() {
|
private function casePage() {
|
||||||
$case = \Drupal::routeMatch()->getParameter('oc_case');
|
$case = \Drupal::routeMatch()->getParameter('oc_case');
|
||||||
$actor_id = \Drupal::service('user.private_tempstore')->get('opencase')->get('actor_id');
|
$actor_id = \Drupal::service('user.private_tempstore')->get('opencase')->get('actor_id');
|
||||||
$actor = \Drupal::entityTypeManager()->getStorage('oc_actor')->load($actor_id);
|
if ($actor_id) { // there is not always one stored.
|
||||||
if ($actor) {
|
|
||||||
$actor = \Drupal::entityTypeManager()->getStorage('oc_actor')->load($actor_id);
|
$actor = \Drupal::entityTypeManager()->getStorage('oc_actor')->load($actor_id);
|
||||||
$caseListLink = $this->getCaseListLink($actor);
|
if ($actor) { // actor may have been deleted.
|
||||||
|
$caseListLink = $this->getCaseListLink($actor);
|
||||||
|
} else {
|
||||||
|
$caseListLink = $this->getCaseListLinkAll();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$caseListLink = $this->getCaseListLinkAll();
|
$caseListLink = $this->getCaseListLinkAll();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user