swagger-api/swagger-codegen
Voir sur GitHubnull pointer exception in networkResponse.statusCode
Open
#3 628 ouverte le 23 août 2016
Client: AndroidIssue: Bughelp wanted
Métriques du dépôt
- Stars
- (12 701 stars)
- Métriques de merge PR
- (Aucune PR mergée en 30 j)
Description
The following is the swagger generated code for android:-
try {
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
if(localVarResponse != null){
return (Lxlresponse) ApiInvoker.deserialize(localVarResponse, "", Lxlresponse.class);
} else {
return null;
}
} catch (ApiException ex) {
throw ex;
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
if(ex.getCause() instanceof VolleyError) {
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());
}
throw ex;
} catch (TimeoutException ex) {
throw ex;
}
}
In the above code, at the following line i'm getting null pointer exception, when there is no response from server:-
throw new ApiException(((VolleyError) ex.getCause()).networkResponse.statusCode, ((VolleyError) ex.getCause()).getMessage());