 
   jsonToCson: ->
     editor = @workspace.getActiveTextEditor()
-    if typeof editor is "undefined"
+    unless editor?
       @atom.beep()
       return
     text = editor.getText()

  # Convert Atom snippet into Sublime Text completion
  atomToSubl: ->
    editor = @workspace.getActiveTextEditor()
    if typeof editor is "undefined"
      @atom.beep()
      return
    text = editor.getText()


      for i, j of v
        unless typeof j.prefix is 'undefined'
          j.body = @trimTabStop(j.body)
          sublime.completions.push { trigger: j.prefix, contents: j.body }

    # Minimum requirements
