fix: correct do script error check (#563)

Correct the error check in the Do method so it's more idiomatic.
1 file changed