summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2017-09-05 18:59:39 +0000
committer android-build-merger <android-build-merger@google.com> 2017-09-05 18:59:39 +0000
commit84be36e7b5655aade511b2b0864c720e0e0e09a2 (patch)
tree1a8023e7ae78d1b43cea23a45a0dabffff53c83a
parentbfe2580b2479391cfc194e538264d79794d077a2 (diff)
parent1e22b33f34d7cd72fa11388e65a1cca8a1d41452 (diff)
Merge "AAPT2: Make sure to fail when XML linking fails" into oc-mr1-dev
am: 1e22b33f34 Change-Id: Ic32bb2076e65d66fbba2c59f29f31d132b12fa0a
-rw-r--r--tools/aapt2/cmd/Link.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index e6bf3a6f9f56..5ad0cdd995ed 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -574,6 +574,11 @@ bool ResourceFileFlattener::Flatten(ResourceTable* table, IArchiveWriter* archiv
if (file_op.xml_to_flatten) {
std::vector<std::unique_ptr<xml::XmlResource>> versioned_docs =
LinkAndVersionXmlFile(table, &file_op);
+ if (versioned_docs.empty()) {
+ error = true;
+ continue;
+ }
+
for (std::unique_ptr<xml::XmlResource>& doc : versioned_docs) {
std::string dst_path = file_op.dst_path;
if (doc->file.config != file_op.config) {