atykhonov / google-translate

Emacs interface to Google Translate
369 stars 47 forks source link

Add checks for array length before `aref`ing #104

Closed narendraj9 closed 4 years ago

narendraj9 commented 4 years ago

I need to change this manually after every new installation so I thought it makes sense to suggest these changes to the repository directly. Thanks! :)

narendraj9 commented 4 years ago

I don't know much about what to expect in info so I just chose to make sure that all arefs are checked for the index we use. (aref info 1) fails if the length is not equal or greater than 2.

stardiviner commented 4 years ago

This function is used to check the misspelled, and give out suggestions. If empty like empty vector, then no suggestion. If I understand correctly. So checking it is empty is fine.

narendraj9 commented 4 years ago

Okay, that makes sense. Thanks! :)

stardiviner commented 4 years ago

This is fixed in https://github.com/atykhonov/google-translate/pull/109