Don't assume save is always passed a success callback

This commit is contained in:
Corey Johnson & Nathan Sobo 2012-08-30 16:12:34 -06:00
parent bd1982ede1
commit 92d728295f

View File

@ -517,14 +517,14 @@ class Editor extends View
$(window).off 'resize', @_setSoftWrapColumn
save: (onSuccess) ->
if not @getPath()
if @getPath()
@getBuffer().save()
onSuccess?()
else
atom.showSaveDialog (path) =>
if path
@getBuffer().saveAs(path)
onSuccess()
else
@getBuffer().save()
onSuccess()
onSuccess?()
subscribeToFontSize: ->
return unless rootView = @rootView()