Fix empty resource list index out of range error

The patch append resource_name into the fields when the resources are
empty. So to avoid the index out of range error.

Change-Id: I068d1ea199c7506aacaf4692479f9070107db724
Closes-Bug: #1307269
Merge "Fix empty resource list index out of range error"