Skip to content

Commit b5d05be

Browse files
committed
5.0.2
1 parent fdcfcd6 commit b5d05be

File tree

11 files changed

+32
-11
lines changed

11 files changed

+32
-11
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## [5.0.2](https://github.com/deltaDNA/android-sdk/releases/tag/5.0.2)
4+
5+
## Fixed
6+
- Fixed a Null Pointer Exception that could occur when getting an error response from the GeoAPI endpoint
7+
38
## [5.0.1](https://github.com/deltaDNA/android-sdk/releases/tag/5.0.1)
49

510
## Fixed

README-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ allprojects {
4343
```
4444
在你APP的构建脚本
4545
```groovy
46-
compile 'com.deltadna.android:deltadna-sdk:5.0.1'
46+
compile 'com.deltadna.android:deltadna-sdk:5.0.2'
4747
```
4848

4949
## 初始化

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ allprojects {
4949
In your app's build script:
5050
```groovy
5151
dependencies {
52-
implementation 'com.deltadna.android:deltadna-sdk:5.0.1'
52+
implementation 'com.deltadna.android:deltadna-sdk:5.0.2'
5353
}
5454
```
5555
The Java source and target compatibility needs to be set to 1.8 in you app's build script:

examples/demo-forget-me/src/main/java/com/deltadna/android/sdk/example/ExampleApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void onSuccess(boolean requiresConsent) {
5353

5454
@Override
5555
public void onFailure(Throwable exception) {
56-
Log.e("EXAMPLE", "Failed to check for PIPL consent", exception);
56+
Log.e("EXAMPLE", "Failed to check for PIPL consent " + exception.getMessage(), exception);
5757
// Try again later.
5858
}
5959
});

examples/demo/src/main/java/com/deltadna/android/sdk/example/ExampleApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void onSuccess(boolean requiresConsent) {
5353

5454
@Override
5555
public void onFailure(Throwable exception) {
56-
Log.e("EXAMPLE", "Failed to check for PIPL consent", exception);
56+
Log.e("EXAMPLE", "Failed to check for PIPL consent " + exception.getMessage(), exception);
5757
// Try again later.
5858
}
5959
});

examples/notifications-style/src/main/java/com/deltadna/android/sdk/notifications/example/ExampleApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void onSuccess(boolean requiresConsent) {
4545

4646
@Override
4747
public void onFailure(Throwable exception) {
48-
Log.e("EXAMPLE", "Failed to check for PIPL consent", exception);
48+
Log.e("EXAMPLE", "Failed to check for PIPL consent " + exception.getMessage(), exception);
4949
// Try again later.
5050
}
5151
});

examples/notifications/src/main/java/com/deltadna/android/sdk/notifications/example/ExampleApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void onSuccess(boolean requiresConsent) {
4646

4747
@Override
4848
public void onFailure(Throwable exception) {
49-
Log.e("EXAMPLE", "Failed to check for PIPL consent", exception);
49+
Log.e("EXAMPLE", "Failed to check for PIPL consent " + exception.getMessage(), exception);
5050
// Try again later.
5151
}
5252
});

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.deltadna.android
2-
VERSION_NAME=5.0.1
2+
VERSION_NAME=5.0.2
33

44
POM_DESCRIPTION=deltaDNA SDK for Android
55
POM_URL=https://github.com/deltaDNA/android-sdk

library-notifications/README-CN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ allprojects {
4141
```
4242
在你APP的构建脚本
4343
```groovy
44-
compile 'com.deltadna.android:deltadna-sdk:5.0.1'
45-
compile 'com.deltadna.android:deltadna-sdk-notifications:5.0.1'
44+
compile 'com.deltadna.android:deltadna-sdk:5.0.2'
45+
compile 'com.deltadna.android:deltadna-sdk-notifications:5.0.2'
4646
```
4747

4848
## 整合

library-notifications/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ allprojects {
4646
In your app's build script:
4747
```groovy
4848
dependencies {
49-
implementation 'com.deltadna.android:deltadna-sdk:5.0.1'
50-
implementation 'com.deltadna.android:deltadna-sdk-notifications:5.0.1'
49+
implementation 'com.deltadna.android:deltadna-sdk:5.0.2'
50+
implementation 'com.deltadna.android:deltadna-sdk-notifications:5.0.2'
5151
}
5252
```
5353

library/src/main/java/com/deltadna/android/sdk/consent/GeoIpNetworkClient.java

+16
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@ public void fetchGeoIpResponse(Callback callback) {
3030
@Override
3131
public void onCompleted(Response<JSONObject> response) {
3232
try {
33+
if (response == null) {
34+
callback.OnFailure(new Exception("GeoIP returned a null response, please try again."));
35+
return;
36+
}
37+
if (!response.isSuccessful()) {
38+
String errorMessage = "GeoIP request failed with error code " + response.code;
39+
if (response.error != null) {
40+
errorMessage += " " + response.error;
41+
}
42+
callback.OnFailure(new Exception(errorMessage));
43+
return;
44+
}
45+
if (response.body == null) {
46+
callback.OnFailure(new Exception("GeoIP returned a null body but a success code, this may indicate an unexpected response. Please try again."));
47+
return;
48+
}
3349
String identifier = response.body.getString("identifier");
3450
callback.OnSuccess(identifier);
3551
} catch (JSONException e) {

0 commit comments

Comments
 (0)