Fix the condition check of the "get_setting" method of providers, secretaries and admins (#1327)

This commit is contained in:
Alex Tselegidis 2023-01-14 10:12:03 +01:00
parent 59170af997
commit cfe88f8901
3 changed files with 3 additions and 3 deletions

View file

@ -496,7 +496,7 @@ class Admins_model extends EA_Model {
{ {
$settings = $this->db->get_where('user_settings', ['id_users' => $admin_id])->row_array(); $settings = $this->db->get_where('user_settings', ['id_users' => $admin_id])->row_array();
if (empty($settings)) if ( ! array_key_exists($name, $settings))
{ {
throw new RuntimeException('The requested setting value was not found: ' . $admin_id); throw new RuntimeException('The requested setting value was not found: ' . $admin_id);
} }

View file

@ -541,7 +541,7 @@ class Providers_model extends EA_Model {
{ {
$settings = $this->db->get_where('user_settings', ['id_users' => $provider_id])->row_array(); $settings = $this->db->get_where('user_settings', ['id_users' => $provider_id])->row_array();
if (empty($settings[$name])) if ( ! array_key_exists($name, $settings))
{ {
throw new RuntimeException('The requested setting value was not found: ' . $provider_id); throw new RuntimeException('The requested setting value was not found: ' . $provider_id);
} }

View file

@ -518,7 +518,7 @@ class Secretaries_model extends EA_Model {
{ {
$settings = $this->db->get_where('user_settings', ['id_users' => $secretary_id])->row_array(); $settings = $this->db->get_where('user_settings', ['id_users' => $secretary_id])->row_array();
if (empty($settings[$name])) if ( ! array_key_exists($name, $settings))
{ {
throw new RuntimeException('The requested setting value was not found: ' . $secretary_id); throw new RuntimeException('The requested setting value was not found: ' . $secretary_id);
} }