Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
fix assert if an optional dependency of a newly installed addon is no…
Browse files Browse the repository at this point in the history
…t already installed
  • Loading branch information
Jonathan Marshall committed Jan 18, 2012
1 parent 96a2a96 commit f7fc9eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions xbmc/addons/AddonInstaller.cpp
Expand Up @@ -261,7 +261,8 @@ void CAddonInstaller::InstallFromXBMCRepo(const set<CStdString> &addonIDs)

bool CAddonInstaller::CheckDependencies(const AddonPtr &addon)
{
assert(addon.get());
if (!addon.get())
return true; // a NULL addon has no dependencies
ADDONDEPS deps = addon->GetDeps();
CAddonDatabase database;
database.Open();
Expand All @@ -280,9 +281,9 @@ bool CAddonInstaller::CheckDependencies(const AddonPtr &addon)
return false;
}
}
// at this point we have our dep, so check that it's OK as well
// at this point we have our dep, or the dep is optional (and we don't have it) so check that it's OK as well
// TODO: should we assume that installed deps are OK?
if (!CheckDependencies(dep))
if (dep && !CheckDependencies(dep))
return false;
}
return true;
Expand Down

0 comments on commit f7fc9eb

Please sign in to comment.