Fix assumption about DynamicRefTable in aapt
Packages without any resources should not expect to have
a DynamicRefTable.
Bug:16895517
Bug:17056720
Change-Id: Id006f6bdbf08f30505f6ba5982bc9d1b09db0f0a
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 41102fe..c74a373 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -764,12 +764,9 @@
return 1;
}
+ // The dynamicRefTable can be null if there are no resources for this asset cookie.
+ // This fine.
const DynamicRefTable* dynamicRefTable = res.getDynamicRefTableForCookie(assetsCookie);
- if (dynamicRefTable == NULL) {
- fprintf(stderr, "ERROR: failed to find dynamic reference table for asset cookie %d\n",
- assetsCookie);
- return 1;
- }
Asset* asset = NULL;