Skip to content

Commit 1eecd5d

Browse files
committed
Synchronize multiple threads accessing the plugin due to vaults being configured for automount
1 parent 3b7e6f4 commit 1eecd5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/keepassxc/Connection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private boolean isSignal(JSONObject response) {
198198
* @throws IllegalStateException Connection was not initialized before.
199199
* @throws IOException Sending failed due to technical reasons.
200200
*/
201-
private void sendEncryptedMessage(Map<String, Object> msg) throws IOException {
201+
private synchronized void sendEncryptedMessage(Map<String, Object> msg) throws IOException {
202202
var unlockRequested = false;
203203

204204
if (!isConnected()) {
@@ -243,7 +243,7 @@ private void sendEncryptedMessage(Map<String, Object> msg) throws IOException {
243243
* @return The received message, decrypted.
244244
* @throws KeepassProxyAccessException It was impossible to process the requested action.
245245
*/
246-
private JSONObject getEncryptedResponseAndDecrypt(String action) throws KeepassProxyAccessException {
246+
private synchronized JSONObject getEncryptedResponseAndDecrypt(String action) throws KeepassProxyAccessException {
247247
var response = new JSONObject();
248248

249249
try {

0 commit comments

Comments
 (0)