Added null check.

This commit is contained in:
Brianna 2020-09-17 08:43:42 -05:00
parent eca32be192
commit 59b2b3e6b0

View File

@ -109,7 +109,7 @@ public class DataManager extends DataManagerAbstract {
public void createHostEntity(ColdEntityStack stack) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> {
if (stack.getHostUniqueId() == null) return;
if (stack == null || stack.getHostUniqueId() == null) return;
String createSerializedEntity = "INSERT INTO " + this.getTablePrefix() + "host_entities (uuid, create_duplicates) VALUES (?, ?)";
try (PreparedStatement statement = connection.prepareStatement(createSerializedEntity)) {
statement.setString(1, stack.getHostUniqueId().toString());