From ee05c32871e14294aeb182d5e718b177aa51a9a7 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Wed, 8 May 2019 10:37:23 +0100 Subject: [PATCH] Allow pending contact state update not to affect any rows. --- .../src/main/java/org/briarproject/bramble/db/JdbcDatabase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bramble-core/src/main/java/org/briarproject/bramble/db/JdbcDatabase.java b/bramble-core/src/main/java/org/briarproject/bramble/db/JdbcDatabase.java index e7d3a5a49..36cb1ef4f 100644 --- a/bramble-core/src/main/java/org/briarproject/bramble/db/JdbcDatabase.java +++ b/bramble-core/src/main/java/org/briarproject/bramble/db/JdbcDatabase.java @@ -3291,7 +3291,7 @@ abstract class JdbcDatabase implements Database { ps.setInt(1, state.getValue()); ps.setBytes(2, p.getBytes()); int affected = ps.executeUpdate(); - if (affected != 1) throw new DbStateException(); + if (affected < 0 || affected > 1) throw new DbStateException(); ps.close(); } catch (SQLException e) { tryToClose(ps, LOG, WARNING);