Fixing NULL pointer access causing segmentation fault in aapt

In cases where resource packages are generated which does
not have public resources for all resource types - NULL
pointers sneaks into the mOrderedConfigs vector causing
the aapt tool to crash. The solution in this fix simply
ignores the NULL elements when later processing the sorted
vector.

The NULL elements are inserted during applyPublicEntryOrder
function call

Change-Id: I8b7135932e2d235018da2e2f7e09f0d22f1b2f59
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;