Fix no such element with empty optional.

This commit is contained in:
David Kocher
2026-05-09 15:52:45 +02:00
parent feb3dc5a31
commit 7f32491f5c
2 changed files with 2 additions and 4 deletions
@@ -108,8 +108,7 @@ public class CryptoCopyFeature implements Copy {
} }
else { else {
new DefaultCopyFeature(session).withTarget(target).preflight( new DefaultCopyFeature(session).withTarget(target).preflight(
vault.contains(source) ? vault.encrypt(session, source) : source, vault.contains(source) ? vault.encrypt(session, source) : source, copy);
vault.contains(copy.get()) ? Optional.of(vault.encrypt(session, copy.get())) : copy);
} }
} }
@@ -108,8 +108,7 @@ public class CryptoCopyFeature implements Copy {
} }
else { else {
new DefaultCopyFeature(session).withTarget(target).preflight( new DefaultCopyFeature(session).withTarget(target).preflight(
vault.contains(source) ? vault.encrypt(session, source) : source, vault.contains(source) ? vault.encrypt(session, source) : source, copy);
vault.contains(copy.get()) ? Optional.of(vault.encrypt(session, copy.get())) : copy);
} }
} }