From b5458130ba00c15ef468d6180a21994bff3daf42 Mon Sep 17 00:00:00 2001 From: Voyager1 Date: Sat, 23 Mar 2013 07:32:09 +0100 Subject: [PATCH] fixed: addoninstaller unguarded null pointer after b0825b1a212849e52fca27409ea87e81591f7cf4 --- xbmc/addons/AddonInstaller.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp index 3e655bb8297d7..276467a705f19 100644 --- a/xbmc/addons/AddonInstaller.cpp +++ b/xbmc/addons/AddonInstaller.cpp @@ -343,13 +343,14 @@ bool CAddonInstaller::CheckDependencies(const AddonPtr &addon, } // 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 (dep && - std::find(preDeps.begin(), preDeps.end(), dep->ID()) == preDeps.end() && - !CheckDependencies(dep, preDeps)) + if (dep) { - return false; + if (std::find(preDeps.begin(), preDeps.end(), dep->ID()) == preDeps.end() && + !CheckDependencies(dep, preDeps)) + return false; + else + preDeps.push_back(dep->ID()); } - preDeps.push_back(dep->ID()); } return true; }