check if $addonDir is a dir to silence warning if it does not exist

This commit is contained in:
Mario Vavti 2016-05-26 14:33:10 +02:00
parent 9017dcd0fd
commit 24360fd191

View File

@ -1421,6 +1421,7 @@ class Admin extends \Zotlabs\Web\Controller {
function listAddonRepos() {
$addonrepos = [];
$addonDir = __DIR__ . '/../../extend/addon/';
if(is_dir($addonDir)) {
if ($handle = opendir($addonDir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
@ -1429,6 +1430,7 @@ class Admin extends \Zotlabs\Web\Controller {
}
closedir($handle);
}
}
return $addonrepos;
}