Fixed loading invalid plugins crashing the server

This commit is contained in:
Shoghi Cervantes 2014-07-30 16:57:31 +02:00
parent 487ce00542
commit 25f5d409f1

View File

@ -192,6 +192,7 @@ class PluginManager{
continue; continue;
} }
$file = $directory . $file; $file = $directory . $file;
try{
$description = $loader->getPluginDescription($file); $description = $loader->getPluginDescription($file);
if($description instanceof PluginDescription){ if($description instanceof PluginDescription){
$name = $description->getName(); $name = $description->getName();
@ -244,6 +245,9 @@ class PluginManager{
} }
} }
} }
}catch(\Exception $e){
$this->server->getLogger()->error("Could not load '". $file ."' in folder '".$directory."': ".$e->getMessage());
}
} }
} }