`if (!result.error) {` would work too