Skip to content

Commit

Permalink
CRM-21300: Addressed notices due to unexpected NULL from Joomla DB ob…
Browse files Browse the repository at this point in the history
…ject.
  • Loading branch information
universalhandle committed Oct 16, 2017
1 parent 84fcd99 commit 76d556c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CRM/Core/Permission/Joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ private function getUserGroupPermsAssociations() {

$db->setQuery($query);

// Load the result as a stdClass object, decoding JSON on the way
return json_decode($db->loadObject()->rules);
// Joomla gotcha: loadObject returns NULL in the case of no matches.
$result = $db->loadObject();
return $result ? json_decode($result->rules) : (object) array();
}

/**
Expand Down

0 comments on commit 76d556c

Please sign in to comment.