Commit 50fa0de5 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Handle external parts DB entries with missing filename

BUG: 382788
FIXED-IN: 5.6
parent eea4afef
......@@ -168,9 +168,14 @@ bool PartStreamer::streamPayloadToFile(Part &part, const Protocol::PartMetaData
if (part.storage() == Part::External) {
// Part was external and is still external
filename = part.data();
ExternalPartStorage::self()->removePartFile(
ExternalPartStorage::resolveAbsolutePath(filename));
filename = ExternalPartStorage::updateFileNameRevision(filename);
if (!filename.isEmpty()) {
ExternalPartStorage::self()->removePartFile(
ExternalPartStorage::resolveAbsolutePath(filename));
filename = ExternalPartStorage::updateFileNameRevision(filename);
} else {
// recover from data corruption
filename = ExternalPartStorage::nameForPartId(part.id());
}
} else {
// Part wasn't external, but is now
filename = ExternalPartStorage::nameForPartId(part.id());
......
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