Guard against "Illegal offset type in isset or empty"

Change-Id: Iddb2bc8bbc83cd0750dfd812db245f4f25a77354
Merge "Guard against "Illegal offset type in isset or empty""