Added check for mDataPointsToUploadLst being null - fixes #102

This commit is contained in:
Graham Jones
2023-06-17 19:59:39 +01:00
parent 89a3bc8ff7
commit ef95065a3a

View File

@@ -472,6 +472,7 @@ public class LogManager {
if (cursor != null) { if (cursor != null) {
callback.accept(cursor2Json(cursor)); callback.accept(cursor2Json(cursor));
} else { } else {
Log.w(TAG,"getDatapointsByDate() - returned null result");
callback.accept(null); callback.accept(null);
} }
}).execute(); }).execute();
@@ -973,8 +974,11 @@ public class LogManager {
} }
// This starts the process of uploading the datapoints, one at a time. // This starts the process of uploading the datapoints, one at a time.
mCurrentEventRemoteId = eventId; mCurrentEventRemoteId = eventId;
int listLen = 0;
if (mDatapointsToUploadList != null)
listLen = mDatapointsToUploadList.size();
Log.v(TAG, "createEventCallback() - starting datapoints upload with eventId " + mCurrentEventRemoteId + Log.v(TAG, "createEventCallback() - starting datapoints upload with eventId " + mCurrentEventRemoteId +
" Uploading " + mDatapointsToUploadList.size() + " datapoints"); " Uploading " + listLen + " datapoints");
uploadNextDatapoint(); uploadNextDatapoint();
}); });