fix potentially evil case in which no error message is known for an error code.

In this case a NULL ptr was returned and not checked everywhere.