Check if result is valid, before accessing it.