diff --git a/modules/consent/lib/Consent/Store/Database.php b/modules/consent/lib/Consent/Store/Database.php
index 348821894401f27b585973257eb3ed4ffc05d19b..31b4e7fd8a17f6ebb658df0a5b44a419215743f2 100644
--- a/modules/consent/lib/Consent/Store/Database.php
+++ b/modules/consent/lib/Consent/Store/Database.php
@@ -346,13 +346,11 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
 
         $st = $db->prepare($statement);
         if ($st === false) {
-            if ($st === false) {
-                SimpleSAML\Logger::error(
-                    'consent:Database - Error preparing statement \'' .
-                    $statement . '\': ' . self::_formatError($db->errorInfo())
-                );
-                return false;
-            }
+            SimpleSAML\Logger::error(
+                'consent:Database - Error preparing statement \'' .
+                $statement . '\': ' . self::_formatError($db->errorInfo())
+            );
+            return false;
         }
 
         if ($st->execute($parameters) !== true) {