Commit f84da462 authored by Lukas Appelhans's avatar Lukas Appelhans

Do not segfault

parent be23575c
......@@ -38,8 +38,16 @@ UpgradeOperation::~UpgradeOperation()
void UpgradeOperation::start(QList<APM::OperationName> operations, QHash<APM::OptionName, QStringList> options, QStringList args)
QList<Akabei::Package*> pkgs;
foreach (const QString &p, args)
pkgs << Akabei::Backend::instance()->loadPackageFromFile(p);
foreach (const QString &p, args) {
Akabei::Package * pkg = Akabei::Backend::instance()->loadPackageFromFile(p);
if (pkg)
pkgs << pkg;
if (pkgs.isEmpty()) {
emit upgradeFinished();
QueueOperation *op = new QueueOperation(operations.first(), options, this);
op->start(AkabeiClient::Install, pkgs);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment