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,11 +69,13 @@ function getEntityData(entity, dataName) {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function setEntityData(entity, dataName, dataValue, syncToClients = true) { function setEntityData(entity, dataName, dataValue, syncToClients = true) {
if(entity != null) {
if(!isNull(server)) { if(!isNull(server)) {
return entity.setData(dataName, dataValue, syncToClients); return entity.setData(dataName, dataValue, syncToClients);
} else { } else {
return entity.setData(dataName, dataValue); return entity.setData(dataName, dataValue);
} }
}
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------