bugfix: return null if config key doesn't exist

This was previously causing a PHP warning due to returning
a missing key.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-06-29 10:41:54 -07:00
parent a120af5a00
commit 4442ba6703

View file

@ -30,7 +30,9 @@ function config_get($section, $key) {
global $AUR_CONFIG; global $AUR_CONFIG;
config_load(); config_load();
return $AUR_CONFIG[$section][$key]; return isset($AUR_CONFIG[$section][$key])
? $AUR_CONFIG[$section][$key]
: null;
} }
function config_get_int($section, $key) { function config_get_int($section, $key) {