Skip to content

Commit

Permalink
HOTFIX Added condition to not crash when authProviderService returns …
Browse files Browse the repository at this point in the history
…empty object
  • Loading branch information
andriyun committed May 7, 2021
1 parent bec9079 commit c515e44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/os2forms_nemid/src/Element/NemidNemloginLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public static function preRenderLink($element) {
}

$link = $authProviderService->generateLink($nemlogin_link_login_text, $nemlogin_link_logout_text);
$element['#title'] = $link->getText();
$element['#url'] = $link->getUrl();
if ($link instanceof \Drupal\Core\Link) {
$element['#title'] = $link->getText();
$element['#url'] = $link->getUrl();
}

return parent::preRenderLink($element);
}
Expand Down

0 comments on commit c515e44

Please sign in to comment.