fix java.lang.IndexOutOfBoundsException for non existant suggestions
(cherry picked from commit 2a7fd67)