Merge "Fixing NULL pointer access causing segmentation fault in aapt"
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 4cca57f..0ec1aeb 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -3009,7 +3009,7 @@
 
             // We need to write one type chunk for each configuration for
             // which we have entries in this type.
-            const size_t NC = t->getUniqueConfigs().size();
+            const size_t NC = t != NULL ? t->getUniqueConfigs().size() : 0;
             
             const size_t typeSize = sizeof(ResTable_type) + sizeof(uint32_t)*N;