From cf9cea88c31dc116f512f72bea487411b7212c72 Mon Sep 17 00:00:00 2001 From: Shmuel Hazan Date: Sat, 23 Oct 2021 20:43:17 +0300 Subject: [PATCH] DataFile: Skip empty resource attributes --- src/core/DataFile.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 82694b7da..1a470f77b 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -444,7 +444,17 @@ bool DataFile::copyResources(const QString& resourcesDir) { // Get absolute path to resource bool error; - QString resPath = PathUtil::toAbsolute(el.attribute(*res), &error); + auto attribute = el.attribute(*res); + + // Skip empty resources. In some cases, there might be an + // alternative way of actually representing the data (e.g. data element for SampleTCO) + if (attribute.isEmpty()) + { + ++res; + continue; + } + + QString resPath = PathUtil::toAbsolute(attribute, &error); // If we are running without the project loaded (from CLI), "local:" base // prefixes aren't converted, so we need to convert it ourselves if (error)