From de7b74233513b3b962737d95bf1a73be4282452c Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Mon, 7 Aug 2017 11:56:32 -0700 Subject: AAPT2: Make sure to fail when XML linking fails Bug: 64367402 Test: manual Change-Id: I3082887f5e449d8d0dac2aad93a834eb346008ba --- tools/aapt2/cmd/Link.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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> versioned_docs = LinkAndVersionXmlFile(table, &file_op); + if (versioned_docs.empty()) { + error = true; + continue; + } + for (std::unique_ptr& doc : versioned_docs) { std::string dst_path = file_op.dst_path; if (doc->file.config != file_op.config) { -- cgit v1.2.3-59-g8ed1b