Definitions: Fix TypeError: Cannot read property 'length' of undefined
Definitions: Fix TypeError: Cannot read property 'length' of undefined

Add a check that a value exists before attempting to access its 'length'
property.

Bug: T230503
Change-Id: I29d7df4a2c1c84e8ce5517edae50317c2a509a99

wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps