Add error message on empty public resources
This should provide more understandable behavior in the case described in
RELNOTES: none
@@ -337,6 +337,9 @@ class PlaceholderIdFieldInitializerBuilder {
"Cannot force ATTR to have type code other than 0x%02x (got 0x%02x from %s)",
ATTR_TYPE_ID, reservedTypeSlot, previousResource));
}
+ if (reservedTypeSlot == null) {
+ logger.warning(String.format("Invalid public resource of type %s - ignoring", currentType));
+ } else {
allocatedTypeIds.put(currentType, reservedTypeSlot);
ResourceType alreadyAssigned = assignedIds.put(reservedTypeSlot, currentType);
if (alreadyAssigned != null) {
@@ -346,6 +349,7 @@ class PlaceholderIdFieldInitializerBuilder {
reservedTypeSlot, alreadyAssigned, currentType));
}
}
+ }
return allocatedTypeIds;
}
