Skip to content

Commit

Permalink
Fix crashes occuring after stopping a survey
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Serrano committed Mar 27, 2023
1 parent e670372 commit a3aae05
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions 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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -28,14 +28,14 @@ If you use Maven, you can include this library as a dependency:
<dependency>
<groupId>com.wootric</groupId>
<artifactId>wootric-sdk-android</artifactId>
<version>2.24.1</version>
<version>2.24.2</version>
</dependency>
```

### Using Gradle

```xml
implementation 'com.wootric:wootric-sdk-android:2.24.1'
implementation 'com.wootric:wootric-sdk-android:2.24.2'
```

## Initializing Wootric
Expand Down
4 changes: 2 additions & 2 deletions 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
Expand Down
Expand Up @@ -176,6 +176,7 @@ private void runSurvey() {

@Override
public void onSurveyValidated(Settings surveyServerSettings) {
if (currentEvent == null) return;
currentEvent.getSettings().mergeWithSurveyServerSettings(surveyServerSettings);
this.eventQueue.clear();

Expand Down Expand Up @@ -212,7 +213,8 @@ public void onRegisteredEvents(ArrayList<String> registeredEvents) {

@Override
public void onAuthenticateSuccess(String accessToken) {
if(accessToken == null) {
if (currentEvent == null) return;
if (accessToken == null) {
Wootric.notifySurveyFinished(false, false, 0);
resetSurvey();
return;
Expand All @@ -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() ||
Expand All @@ -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();
Expand Down

0 comments on commit a3aae05

Please sign in to comment.