TIMOB-10017 add null checking

Added a null value checking.
https://jira.appcelerator.org/browse/TIMOB-10017