Commit af103a8b authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

flatpak: The unreachable is reachable

Instead of making findSource() unreachable, return a null instance and
move on with life.

The case that it's crashing for the reported bug was already if'd out,
so we just assert() on the other use-case where it actually does make
sense.

BUG: 443745
parent e97ee7d2
Pipeline #231347 passed with stage
in 3 minutes and 13 seconds
......@@ -520,7 +520,7 @@ QSharedPointer<FlatpakSource> FlatpakBackend::findSource(FlatpakInstallation *in
}
qWarning() << "Could not find source:" << installation << origin;
Q_UNREACHABLE();
return {};
}
FlatpakResource *FlatpakBackend::getRuntimeForApp(FlatpakResource *resource) const
......@@ -1708,6 +1708,7 @@ Transaction *FlatpakBackend::installApplication(AbstractResource *app, const Add
if (status == Transaction::Status::DoneStatus) {
if (auto tempSource = resource->temporarySource()) {
auto source = findSource(resource->installation(), resource->origin());
Q_ASSERT(source);
resource->setTemporarySource({});
const auto id = resource->uniqueId();
source->m_resources.insert(id, resource);
......
Supports Markdown
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