mirror of
https://github.com/QuasarApp/installer-framework.git
synced 2025-05-21 17:19:34 +00:00
Fix possible null pointer access.
Change-Id: I2cb1c8b70d41c764e0f9e47637b951c480ebcb5c Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
This commit is contained in:
parent
8d060e6910
commit
b9d855d8cf
@ -42,8 +42,13 @@ namespace QInstaller {
|
||||
|
||||
QStringList ComponentChecker::checkComponent(Component *component)
|
||||
{
|
||||
PackageManagerCore *core = component->packageManagerCore();
|
||||
QStringList checkResult;
|
||||
if (!component)
|
||||
return checkResult;
|
||||
|
||||
PackageManagerCore *core = component->packageManagerCore();
|
||||
if (!core)
|
||||
return checkResult;
|
||||
|
||||
const bool defaultPropertyScriptValue = component->variables().value(scDefault).compare(scScript, Qt::CaseInsensitive) == 0;
|
||||
const bool defaultPropertyValue = component->variables().value(scDefault).compare(scTrue, Qt::CaseInsensitive) == 0;
|
||||
@ -74,7 +79,7 @@ QStringList ComponentChecker::checkComponent(Component *component)
|
||||
foreach (const QString &dependency, dependencies) {
|
||||
Component *dependencyComponent = PackageManagerCore::componentByName(
|
||||
dependency, allComponents);
|
||||
if (autoDependencies.contains(dependencyComponent->name())) {
|
||||
if (dependencyComponent && autoDependencies.contains(dependencyComponent->name())) {
|
||||
checkResult << QString::fromLatin1("Component %1 specifies both dependency "
|
||||
"and auto dependency on component %2. The dependency might be superfluous.")
|
||||
.arg(component->name(), dependencyComponent->name());
|
||||
|
Loading…
x
Reference in New Issue
Block a user