Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If response body does not have ContentType plugin crash #32

Open
leoleitemelo opened this issue Dec 2, 2022 · 0 comments
Open

If response body does not have ContentType plugin crash #32

leoleitemelo opened this issue Dec 2, 2022 · 0 comments

Comments

@leoleitemelo
Copy link

At FetchPlugin.java line 123, when trying to check if response is a image if the response does not have ContentType it throw null pointer exception.
This changes address this issue for me
at line 123 i change from
if (response.body().contentType().type().equals("image")) {

to

if (response.body().contentType() != null && response.body().contentType().type().equals("image")) {

@leoleitemelo leoleitemelo changed the title If response cody does not have ContentType plugin crash If response body does not have ContentType plugin crash Dec 2, 2022
leoleitemelo added a commit to leoleitemelo/cordova-plugin-fetch that referenced this issue Dec 2, 2022
validate if is different of null before check if it is an image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant