Skip to content

Commit

Permalink
fix for issue aporat#32
Browse files Browse the repository at this point in the history
validate if is different of null before check if it is an image
  • Loading branch information
leoleitemelo authored Dec 2, 2022
1 parent 786787d commit 0ea472c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/android/com/adobe/phonegap/fetch/FetchPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void onResponse(Call call, Response response) throws IOException {

result.put("headers", allHeaders);

if (response.body().contentType().type().equals("image")) {
if (response.body().contentType() != null && response.body().contentType().type().equals("image")) {
result.put("isBlob", true);
result.put("body", Base64.encodeToString(response.body().bytes(), Base64.DEFAULT));
} else {
Expand Down

0 comments on commit 0ea472c

Please sign in to comment.