fix undefined index error

#5696 

### Hotfix for SCHOLAR-3.12

#### Changes

* Check first before trying to access language object from `langauge_list()` return value.