The GetFolderList function seems to throw an exception when the explored folder is empty with OneDrive.
For the moment I kill the exception violently with a try except end....
csCloudRef.BeginSync;
try
try
ciCloud := csCloudRef.GetFolderList(AFolder);
except
ciCloud := nil; // Sur OneDrive, déclenche une exception sur un dossier vide
end;
finally
csCloudRef.EndSync;
end;
The GetFolderList call should only throw an exception when your AFolder.ID is empty. Please make sure the ID is filled in or modify your code so GetFolderList is not called when the ID is empty.
If there is another exception, please provide the exact error message to help us investigate this further.
My app displays a list of files at the root using GetFolderList(nil).Then if you click on a folder, we display the contents of that folder by using GetFolderList with the corresponding TMSFNCCloudItem object as a parameter. This works all the time except on OneDrive if the opened directory is empty.
The following exception is thrown: "Impossible d'affecter nil à TTMSFNCCloudMicrosoftOneDriveItems"
You can easily reproduce this issue with the Cloud Storage Demo and changing GetFolderListHierarchical by GetFolderList