From ea69a893743f8c2650b578df13f8fd3bd407ddad Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 4 Jun 2021 11:03:21 +1000 Subject: [PATCH] [REF] Fix Authx tests on Druapl 8/9 by ensuring that we only return an id for the user id if it is greater than 0 --- ext/authx/Civi/Authx/Drupal8.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/authx/Civi/Authx/Drupal8.php b/ext/authx/Civi/Authx/Drupal8.php index bb817e7b457c..54f8c122a697 100644 --- a/ext/authx/Civi/Authx/Drupal8.php +++ b/ext/authx/Civi/Authx/Drupal8.php @@ -54,7 +54,7 @@ public function loginStateless($userId) { */ public function getCurrentUserId() { $user = \Drupal::currentUser(); - return $user ? $user->getAccount()->id() : NULL; + return $user && $user->getAccount()->id() ? $user->getAccount()->id() : NULL; } }