diff --git a/KoenZomers.KeePass.OneDriveSync/Providers/OneDriveProvider.cs b/KoenZomers.KeePass.OneDriveSync/Providers/OneDriveProvider.cs index 7cddc44..5c7366f 100644 --- a/KoenZomers.KeePass.OneDriveSync/Providers/OneDriveProvider.cs +++ b/KoenZomers.KeePass.OneDriveSync/Providers/OneDriveProvider.cs @@ -153,6 +153,12 @@ public static async Task SyncUsingOneDriveCloudProvider(Configuration data // Get the folder in which the KeePass file resides folder = await oneDriveApi.GetItemById(databaseConfig.RemoteFolderId); + if (folder == null) + { + updateStatus("Unable to download database from OneDrive. Remote path cannot be found."); + return false; + } + // Locate the KeePass file in the folder oneDriveItem = await oneDriveApi.GetItemInFolder(folder, databaseConfig.RemoteFileName); }