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.