Skip to content

Commit 8477021

Browse files
committed
Do not throw exception on valut generate key
1 parent c80526b commit 8477021

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Secrets/SodiumVault.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public function generateKeys(bool $override = false): bool
4747
$this->lastMessage = null;
4848

4949
if (null === $this->encryptionKey && '' !== $this->decryptionKey = (string) $this->decryptionKey) {
50-
throw new \LogicException('Cannot generate keys when a decryption key has been provided while instantiating the vault.');
50+
$this->lastMessage = 'Cannot generate keys when a decryption key has been provided while instantiating the vault.';
51+
52+
return false;
5153
}
5254

5355
try {

0 commit comments

Comments
 (0)