Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

null check body on http request, cleanup code #11413

Merged
merged 1 commit into from
Mar 8, 2018
Merged

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Mar 8, 2018

Closes #11412

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Mar 8, 2018
@tobrun tobrun added this to the android-v6.0.0 milestone Mar 8, 2018
@tobrun tobrun self-assigned this Mar 8, 2018
@tobrun tobrun requested a review from LukasPaczos March 8, 2018 06:43
Copy link
Contributor

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Could we add some explicit warnings?


try {
HttpUrl httpUrl = HttpUrl.parse(resourceUrl);
final String host = httpUrl.host().toLowerCase(MapboxConstants.MAPBOX_LOCALE);
if (httpUrl == null) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we print some kind of a warning here? Or even pass the warning to core?

@@ -136,19 +122,24 @@ public void onResponse(Call call, Response response) throws IOException {
}
}

ResponseBody responseBody = response.body();
if (responseBody == null) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@tobrun tobrun merged commit ea525fd into release-boba Mar 8, 2018
@tobrun tobrun deleted the tvn-http-cleanup branch March 8, 2018 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants