fix returning NullPointerException on getErrorCode of null error message