If no data existed (ie. no labels) & the user typed ~ it would throw a JS error. This fixes that by checking the length of the returned array.
~