Skip to content

Commit 2cebcbf

Browse files
Copilotd2dyno1
andauthored
fix: treat missing complementation file as non-fatal
Agent-Logs-Url: https://github.com/securefolderfs-community/SecureFolderFS/sessions/97747175-69cf-4f84-9b88-ba52b9ef01f2 Co-authored-by: d2dyno1 <53011783+d2dyno1@users.noreply.github.com>
1 parent 6edf734 commit 2cebcbf

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Core/SecureFolderFS.Core/VaultAccess/VaultReader.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ public async Task<V4VaultConfigurationDataModel> ReadV4ConfigurationAsync(Cancel
5555

5656
public async Task<VaultSharesDataModel?> ReadComplementationAsync(CancellationToken cancellationToken)
5757
{
58-
if (await _vaultFolder.GetFirstByNameAsync(Constants.Vault.Names.VAULT_COMPLEMENTATION_FILENAME, cancellationToken) is not IFile complementFile)
58+
IFile complementFile;
59+
try
60+
{
61+
complementFile = await _vaultFolder.GetFileByNameAsync(Constants.Vault.Names.VAULT_COMPLEMENTATION_FILENAME, cancellationToken);
62+
}
63+
catch (FileNotFoundException)
64+
{
5965
return null;
66+
}
6067

6168
return await ReadDataAsync<VaultSharesDataModel?>(complementFile, _serializer, cancellationToken);
6269
}

0 commit comments

Comments
 (0)