Skip to content

Commit

Permalink
make sure module exists
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed May 28, 2020
1 parent 3c0badc commit ad51d61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 11 additions & 1 deletion app/Utilities/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,17 @@ public static function all()
$versions = Versions::all($modules);

foreach ($versions as $alias => $latest_version) {
$installed_version = ($alias == 'core') ? version('short') : module($alias)->get('version');
if ($alias == 'core') {
$installed_version = version('short');
} else {
$module = module($alias);

if (!$module instanceof \Akaunting\Module\Module) {
continue;
}

$installed_version = $module->get('version');
}

if (version_compare($installed_version, $latest_version, '>=')) {
continue;
Expand Down
3 changes: 1 addition & 2 deletions app/Utilities/Versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Utilities;

use Akaunting\Module\Module;
use App\Traits\SiteApi;
use Cache;
use Date;
Expand Down Expand Up @@ -89,7 +88,7 @@ public static function all($modules = null)
$module = module($module);
}

if (!$module instanceof Module) {
if (!$module instanceof \Akaunting\Module\Module) {
continue;
}

Expand Down

0 comments on commit ad51d61

Please sign in to comment.