dont let setInternalFolderSyncTimestamp via null value, dont return nullable value

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-09-24 10:57:09 +02:00 committed by Alper Öztürk
parent edb2a4a4d3
commit 90be7e66b1
2 changed files with 6 additions and 2 deletions

View file

@ -1125,7 +1125,7 @@ public class FileDataStorageManager {
ocFile.setLivePhoto(fileEntity.getMetadataLivePhoto());
ocFile.setHidden(nullToZero(fileEntity.getHidden()) == 1);
ocFile.setE2eCounter(fileEntity.getE2eCounter());
ocFile.setInternalFolderSyncTimestamp(fileEntity.getInternalTwoWaySync());
ocFile.setInternalFolderSyncTimestamp(nullToZero(fileEntity.getInternalTwoWaySync()));
String sharees = fileEntity.getSharees();
// Surprisingly JSON deserialization causes significant overhead.

View file

@ -1076,11 +1076,15 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
}
public boolean isInternalFolderSync() {
if (internalFolderSyncTimestamp == null) {
return false;
}
return internalFolderSyncTimestamp >= 0;
}
public Long getInternalFolderSyncTimestamp() {
return internalFolderSyncTimestamp;
return Objects.requireNonNullElse(internalFolderSyncTimestamp, -1L);
}
public void setInternalFolderSyncTimestamp(Long internalFolderSyncTimestamp) {