Fixed crash when statusCode is undefined