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