Attempting to cast null data returns an empty array (e.g. when searches have no results)

Fixes #1