don't try to fill additional properties for erased entities

This commit is contained in:
zadam 2021-07-03 20:52:40 +02:00
parent 61e78858bc
commit 5011b6a51a

View file

@ -75,6 +75,10 @@ function sendMessageToAllClients(message) {
} }
function fillInAdditionalProperties(entityChange) { function fillInAdditionalProperties(entityChange) {
if (entityChange.isErased) {
return;
}
// fill in some extra data needed by the frontend // fill in some extra data needed by the frontend
if (entityChange.entityName === 'attributes') { if (entityChange.entityName === 'attributes') {
entityChange.entity = sql.getRow(`SELECT * FROM attributes WHERE attributeId = ?`, [entityChange.entityId]); entityChange.entity = sql.getRow(`SELECT * FROM attributes WHERE attributeId = ?`, [entityChange.entityId]);