Fixed crash when deleting component in right-click menu.