Skip to content

Commit 58cbfce

Browse files
committed
Null error handling to SyncService
1 parent 3910548 commit 58cbfce

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignalStateSynchronizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ private Set<String> getGroupChangeFields(UserState changedTo) {
285285
|| syncValues.optDouble("lat") != changedTo.syncValues.getDouble("lat")
286286
|| syncValues.optDouble("long") != changedTo.syncValues.getDouble("long")
287287
|| syncValues.optDouble("loc_acc") != changedTo.syncValues.getDouble("loc_acc")
288-
|| syncValues.optDouble("loc_type") != changedTo.syncValues.getDouble("loc_type")) {
288+
|| syncValues.optInt("loc_type") != changedTo.syncValues.optInt("loc_type")) {
289289
if (changedTo.dependValues.optBoolean("loc_bg"))
290290
changedTo.syncValues.put("loc_bg", changedTo.dependValues.optBoolean("loc_bg"));
291291
return LOCATION_FIELDS_SET;

OneSignalSDK/onesignal/src/main/java/com/onesignal/SyncService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,15 @@ public void complete(LocationGMS.LocationPoint point) {
100100

101101
@Override
102102
public void onCreate() {
103-
104103
}
105104

106105
@Override
107106
public int onStartCommand(Intent intent, int flags, int startId) {
108-
int task = intent.getIntExtra("task", 0);
107+
int task;
108+
if (intent != null)
109+
task = intent.getIntExtra("task", 0);
110+
else
111+
task = TASK_SYNC;
109112

110113
if (task == TASK_APP_STARTUP)
111114
startedFromActivity = true;

0 commit comments

Comments
 (0)