Check if class exists before checking if it's a search provider

This commit is contained in:
Kode 2022-03-26 18:59:49 +00:00
parent 724110dad2
commit 74196a2bfa

View file

@ -169,7 +169,7 @@ class Item extends Model
public static function isEnhanced($class)
{
if ($class === null || $class === 'null') {
if (!class_exists($class) || $class === null || $class === 'null') {
return false;
}
$app = new $class;
@ -179,6 +179,9 @@ class Item extends Model
public static function isSearchProvider($class)
{
if (!class_exists($class) || $class === null || $class === 'null') {
return false;
}
$app = new $class;
return ((bool) ($app instanceof \App\SearchInterface)) ? $app : false;