Don't splode in error type checks if given nil

These two testing utils assumed that they got an error, and checked
its type; however, the most likely failure case is that there's no
error (i.e., nil). In that case they would cause a NPE panic.
Merge pull request #256 from squaremo/dont_splode

Don't splode in error type checks if given nil