Add check for null entity in new data util
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user