issue #59: verify result is valid before trying to use it.