Check if class exists before checking if it's a search provider
This commit is contained in:
parent
724110dad2
commit
74196a2bfa
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue