[UTIL] Update Common::config to ensure the values queried exist
This commit is contained in:
parent
ae373c7d96
commit
8ce0f05371
@ -40,7 +40,12 @@ abstract class Common
|
|||||||
*/
|
*/
|
||||||
public static function config(string $section, string $setting)
|
public static function config(string $section, string $setting)
|
||||||
{
|
{
|
||||||
return unserialize(DB::find('config', ['section' => $section, 'setting' => $setting])->getValue());
|
$c = DB::find('config', ['section' => $section, 'setting' => $setting]);
|
||||||
|
if ($c === null) {
|
||||||
|
throw new Exception("The field section = {$section} and setting = {$setting} doesn't exist");
|
||||||
|
}
|
||||||
|
|
||||||
|
return unserialize($c->getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user