Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix material removal errors due to missing source component (#10433)
Browse files Browse the repository at this point in the history
  • Loading branch information
AidanCaruso authored Jun 21, 2024
1 parent aedf20e commit 37dcc1c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ export const createMaterialEntity = (material: Material, path?: string, user?: E

export const removeMaterial = (entity: Entity) => {
const name = getComponent(entity, NameComponent)
const hash = hashMaterial(getComponent(entity, SourceComponent), name)
delete materialByHash[hash]
if (hasComponent(entity, SourceComponent)) {
const hash = hashMaterial(getComponent(entity, SourceComponent), name)
delete materialByHash[hash]
}
removeEntity(entity)
}

Expand Down

0 comments on commit 37dcc1c

Please sign in to comment.