diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a4d84c..f4263be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.24.2 (2023-03-27) + +- Fix crash after stopping a survey + ## 2.24.1 (2023-03-07) - Fix missing files on Maven diff --git a/README.md b/README.md index a1eaff0..08e737a 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,14 @@ If you use Maven, you can include this library as a dependency: com.wootric wootric-sdk-android - 2.24.1 + 2.24.2 ``` ### Using Gradle ```xml -implementation 'com.wootric:wootric-sdk-android:2.24.1' +implementation 'com.wootric:wootric-sdk-android:2.24.2' ``` ## Initializing Wootric diff --git a/androidsdk/gradle.properties b/androidsdk/gradle.properties index d150644..00af601 100644 --- a/androidsdk/gradle.properties +++ b/androidsdk/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=2.24.1 -VERSION_CODE=2241 +VERSION_NAME=2.24.2 +VERSION_CODE=2242 GROUP=com.wootric POM_DESCRIPTION=WootricSDK Android diff --git a/androidsdk/src/main/java/com/wootric/androidsdk/SurveyManager.java b/androidsdk/src/main/java/com/wootric/androidsdk/SurveyManager.java index 845778f..3a41619 100644 --- a/androidsdk/src/main/java/com/wootric/androidsdk/SurveyManager.java +++ b/androidsdk/src/main/java/com/wootric/androidsdk/SurveyManager.java @@ -176,6 +176,7 @@ private void runSurvey() { @Override public void onSurveyValidated(Settings surveyServerSettings) { + if (currentEvent == null) return; currentEvent.getSettings().mergeWithSurveyServerSettings(surveyServerSettings); this.eventQueue.clear(); @@ -212,7 +213,8 @@ public void onRegisteredEvents(ArrayList registeredEvents) { @Override public void onAuthenticateSuccess(String accessToken) { - if(accessToken == null) { + if (currentEvent == null) return; + if (accessToken == null) { Wootric.notifySurveyFinished(false, false, 0); resetSurvey(); return; @@ -229,6 +231,7 @@ private void sendOfflineData() { @Override public void onGetEndUserIdSuccess(long endUserId) { + if (currentEvent == null) return; currentEvent.getEndUser().setId(endUserId); if(currentEvent.getEndUser().hasProperties() || @@ -242,11 +245,13 @@ public void onGetEndUserIdSuccess(long endUserId) { @Override public void onEndUserNotFound() { + if (currentEvent == null) return; sendCreateEndUserRequest(); } @Override public void onCreateEndUserSuccess(long endUserId) { + if (currentEvent == null) return; currentEvent.getEndUser().setId(endUserId); showSurvey();