Don't break if default search provider deleted from yaml

Fixes #904
This commit is contained in:
KodeStar 2022-11-17 00:20:54 +00:00 committed by GitHub
parent 15f5c3e5be
commit aa98c3505c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,7 +75,7 @@ class Setting extends Model
if ($this->key === 'search_provider') {
$options = Search::providers()->pluck('name', 'id')->toArray();
}
$value = __($options[$this->value]);
$value = (array_key_exists($this->value, $options)) ? __($options[$this->value]) : __('app.options.none');
} else {
$value = __('app.options.none');
}