Skip to content

Commit

Permalink
Resolve deprecated error passing null to string parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottVerbeek committed Jan 11, 2024
1 parent 11d18b7 commit 00bf2ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion classes/admin/admin_setting_userselection.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public function __construct($name, $visiblename, $description, $defaultsetting =
* @return array The ids of the currently selected users.
*/
public function get_setting() {
return explode(',', $this->config_read($this->name));
$setting = $this->config_read($this->name);
if (!$setting) {
return [];
}

return explode(',', $setting);
}

/**
Expand Down

0 comments on commit 00bf2ef

Please sign in to comment.