aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
647 stars 198 forks source link

Selecting an entity and pressing escape to unselect gives an error #684

Closed vincentfretin closed 1 year ago

vincentfretin commented 1 year ago

Selecting an entity and pressing escape to unselect is working but gives the following error

index.js:165 Uncaught TypeError: Cannot read properties of null (reading 'object3D')
    at Inspector.selectEntity (index.js:165:12)
    at Object.onKeyUp (shortcuts.js:42:24)
vincentfretin commented 1 year ago

When using Escape, this is called https://github.com/aframevr/aframe-inspector/blob/aecc85bcd2dde219fc272240bf8bfcd3ebf87b03/src/lib/shortcuts.js#L42 so param entity=null but there is no check for entity null here https://github.com/aframevr/aframe-inspector/blob/aecc85bcd2dde219fc272240bf8bfcd3ebf87b03/src/index.js#L165