Check for undefined or empty array