[TIMOB-13560] Add nil check

Test is in [JIRA](https://jira.appcelerator.org/browse/TIMOB-13560)

Run KS for sanity please