From d3ebbafedaa7f5b96030eac9098d8d072c58b164 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 9 Nov 2021 10:49:41 +0100 Subject: [PATCH] Prevent infinite recursion --- SpigotCore_Main/src/de/steamwar/sql/SQL.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/sql/SQL.java b/SpigotCore_Main/src/de/steamwar/sql/SQL.java index 0cffba5..fc8c7a2 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SQL.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SQL.java @@ -171,11 +171,14 @@ public class SQL { private synchronized T prepare(SQLRunnable runnable, Object... objects) { try { - setObjects(objects); - return runnable.run(); - } catch (CommunicationsException e) { - reset(); - return prepare(runnable, objects); + try { + setObjects(objects); + return runnable.run(); + } catch (CommunicationsException e) { + reset(); + setObjects(objects); + return runnable.run(); + } } catch (SQLException e) { throw new SecurityException("Could not execute SQL statement", e); }