Avoid javascript error while tryting to get autonym

For the purpose of tests, we pass language that is known to ime
and that cause js error at $.ime.languages[languageCode].autonym

Added a null check