mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-02-06 14:31:36 +01:00
Merge pull request #2 from HexedHero/fix-npe
Move null check into statement like other methods
This commit is contained in:
commit
300b12502a
@ -57,7 +57,6 @@ public class DataManager extends DataManagerAbstract {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createSpawner(SpawnerStack spawnerStack) {
|
public void createSpawner(SpawnerStack spawnerStack) {
|
||||||
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
||||||
|
|
||||||
@ -88,7 +87,6 @@ public class DataManager extends DataManagerAbstract {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createBlock(BlockStack blockStack) {
|
public void createBlock(BlockStack blockStack) {
|
||||||
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
||||||
|
|
||||||
@ -108,12 +106,11 @@ public class DataManager extends DataManagerAbstract {
|
|||||||
}), "create");
|
}), "create");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createHostEntity(ColdEntityStack stack) {
|
public void createHostEntity(ColdEntityStack stack) {
|
||||||
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
|
||||||
if (stack == null || stack.getHostUniqueId() == null) return;
|
|
||||||
String createSerializedEntity = "INSERT INTO " + this.getTablePrefix() + "host_entities (uuid, create_duplicates) VALUES (?, ?)";
|
String createSerializedEntity = "INSERT INTO " + this.getTablePrefix() + "host_entities (uuid, create_duplicates) VALUES (?, ?)";
|
||||||
try (PreparedStatement statement = connection.prepareStatement(createSerializedEntity)) {
|
try (PreparedStatement statement = connection.prepareStatement(createSerializedEntity)) {
|
||||||
|
if (stack == null || stack.getHostUniqueId() == null) return;
|
||||||
statement.setString(1, stack.getHostUniqueId().toString());
|
statement.setString(1, stack.getHostUniqueId().toString());
|
||||||
statement.setInt(2, stack.getCreateDuplicates());
|
statement.setInt(2, stack.getCreateDuplicates());
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
|
Loading…
Reference in New Issue
Block a user