adobe-photoshop / spaces-design

Adobe Photoshop Design Space
http://adobe-photoshop.github.io/
Other
848 stars 81 forks source link

Bug fix: error when dragging image from browser onto empty artboard. #3797

Closed shaoshing closed 8 years ago

shaoshing commented 8 years ago

This is my second attempt on fixing issue #3635. It turns out that the error is caused by dropping image onto an empty artboard, which triggers layer replacement. Although the new layer is replaced by an existing layer, PS still emitting message with the incorrect ID of the replaced layer, and that's why the layers.addLayers failed. This PR checks if the id from event.layerID exists before adding a new layer.

iwehrman commented 8 years ago

Looks good!