From cd3b4db3f4009b32abf538d10c4b6ab42ee44d7e Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 27 May 2020 11:29:24 +0200 Subject: [PATCH] fix: Database return null if object does not exist --- varo/src/main/java/de/cliffbreak/varo/database/Database.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/varo/src/main/java/de/cliffbreak/varo/database/Database.java b/varo/src/main/java/de/cliffbreak/varo/database/Database.java index 82affec..785784e 100644 --- a/varo/src/main/java/de/cliffbreak/varo/database/Database.java +++ b/varo/src/main/java/de/cliffbreak/varo/database/Database.java @@ -77,6 +77,9 @@ public class Database { try { final Statement s = this.conn.createStatement(); final ResultSet rs = s.executeQuery("SELECT " + type + " FROM playercache WHERE `player` ='" + uuid + "';"); + if (rs.next() == false) { + return null; + } final Object obj = rs.getObject(type); s.close(); return obj;