fix: Database return null if object does not exist
This commit is contained in:
parent
bc338ed4cf
commit
cd3b4db3f4
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue