Handle uncaught errors gracefully. Normalise lucene result so rows is always present. Issue: medic/medic-webapp#652