From c7614e5d1e8f9139cccf6ab9b78dda16b98f7656 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Thu, 16 Mar 2017 16:54:23 -0700 Subject: AAPT: Version to v26 Bug: 35908647 Change-Id: I307fb2f666cb8519adb9a7f676b87706dc6c683f Test: manual --- tools/aapt/Resource.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tools/aapt/Resource.cpp') diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 3330b1a78c1e..2bf52066b618 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -1403,7 +1403,8 @@ status_t buildResources(Bundle* bundle, const sp& assets, spgetPrintableSource(); err = compileXmlFile(bundle, assets, String16(it.getBaseName()), it.getFile(), &table, xmlFlags); - if (err == NO_ERROR) { + // Only verify IDs if there was no error and the file is non-empty. + if (err == NO_ERROR && it.getFile()->hasData()) { ResXMLTree block; block.setTo(it.getFile()->getData(), it.getFile()->getSize(), true); checkForIds(src, block); @@ -1550,7 +1551,7 @@ status_t buildResources(Bundle* bundle, const sp& assets, spgetPrintableSource(); err = compileXmlFile(bundle, assets, String16(it.getBaseName()), it.getFile(), &table, xmlFlags); - if (err == NO_ERROR) { + if (err == NO_ERROR && it.getFile()->hasData()) { ResXMLTree block; block.setTo(it.getFile()->getData(), it.getFile()->getSize(), true); checkForIds(src, block); @@ -1598,7 +1599,7 @@ status_t buildResources(Bundle* bundle, const sp& assets, sphasData()) { assets->addResource(workItem.resPath.getPathLeaf(), workItem.resPath, workItem.file, -- cgit v1.2.3-59-g8ed1b