[CODE lang="b4x" title="This is the whole sub the highlighted line is where the IDE shows the error occurs" highlight="32"]Sub Sync
If Not(Syncing) Then
Syncing = True
ErrorOccured = False
LogColor($"SyncService Starting..."$,Colors.Green)
If File.Exists(File.DirInternal,MapFileSaveName) Then
RetryMap = File.ReadMap(File.DirInternal,MapFileSaveName)
End If
UnsyncedEvents = DataAccess.GetEventsWithoutSync
If UnsyncedEvents.Size = 0 Then StopService(Me)
For Each Event As WorkorderEvent In UnsyncedEvents
Dim Key As String = Event.id
Dim Attempts As String = "0"
If Not(RetryMap.ContainsKey(Key)) Then
RetryMap.Put(Key,Attempts)
End If
Attempts = RetryMap.Get(Key)
If Attempts >= RetryLimit Then
LogColor($"Event retry limit reached EventId:${Event.id}"$,Colors.Red)
DataAccess.InsertRemoteID(0,Event.id)
RemoveEventFromList(Event)
RetryMap.Remove(Key)
If Not(AlreadyQueuedToStart) Then
Log("Sync failed events queued to start")
StartServiceAtExact(SyncFailedEvents, DateTime.Now + RetryFailedTime ,True)
AlreadyQueuedToStart = True
End If
Else
LogColor($"Try Sync: EventID: ${Event.id} attempt: ${RetryMap.Get(Key)}"$,Colors.Magenta)
API.CreateEvent(Event)
AddOnMap(Event)
End If
Next
If UnsyncedEvents.Size = 0 Then StopService(Me)
Else
LogColor($"ShouldTryAgain = True"$,Colors.Yellow)
ShouldStartAgain = True
End If
End Sub[/CODE]
That is the whole sub with the line where the IDE says the Error occurs the full error is: