diff --git a/lib/services/remote_sync_service.dart b/lib/services/remote_sync_service.dart index 12561c1cc..2c614efee 100644 --- a/lib/services/remote_sync_service.dart +++ b/lib/services/remote_sync_service.dart @@ -279,10 +279,14 @@ class RemoteSyncService { localIDsToSync.removeAll(alreadyClaimedLocalIDs); } - if (localIDsToSync.isEmpty || deviceCollection.collectionID == -1) { + if (localIDsToSync.isEmpty) { continue; } await _createCollectionForDevicePath(deviceCollection); + if (deviceCollection.collectionID == -1) { + _logger.finest('DeviceCollection should not be -1 here'); + continue; + } moreFilesMarkedForBackup = true; await _db.setCollectionIDForUnMappedLocalFiles(