Don't error when detaching from history with no sharejsDoc

This commit is contained in:
James Allen 2018-02-13 08:43:00 +00:00
parent 5d3ecdb924
commit 29d2b408ad

View file

@ -428,7 +428,8 @@ define [
rendererData.lineHeight = editor.renderer.lineHeight
scope.$on '$destroy', () ->
detachFromAce(scope.sharejsDoc)
if scope.sharejsDoc?
detachFromAce(scope.sharejsDoc)
scope.$emit "#{scope.name}:inited", editor