Check for is_object

Without this , it give php-warning-invalid-argument-supplied-for-foreach error.
Merge pull request #462 from paanblogger/develop

Check for is_object