Add check for null entity in new data util

This commit is contained in:
Vortrex
2020-12-18 19:06:39 -06:00
parent cfdf58dfb3
commit 92f50b51fa

View File

@@ -69,10 +69,12 @@ function getEntityData(entity, dataName) {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function setEntityData(entity, dataName, dataValue, syncToClients = true) { function setEntityData(entity, dataName, dataValue, syncToClients = true) {
if(!isNull(server)) { if(entity != null) {
return entity.setData(dataName, dataValue, syncToClients); if(!isNull(server)) {
} else { return entity.setData(dataName, dataValue, syncToClients);
return entity.setData(dataName, dataValue); } else {
return entity.setData(dataName, dataValue);
}
} }
} }