wesbaker / atom-docksend

MIT License
1 stars 1 forks source link

Uncaught TypeError: Cannot read property 'isModified' of undefined #2

Closed stuh closed 8 years ago

stuh commented 8 years ago

[Enter steps to reproduce below:]

  1. select png in tree view
  2. hit ctrl-u to upload screenshot 2015-08-28 13 06 23

Had a dig and it looks like imageeditor pane's make the code fail as they do not report their path the same. If you change line 20 from editor = atom.workspace.getActiveTextEditor() to editor = atom.workspace.getActivePaneItem() it works.

I had to remove the if editor.isModified() editor.save() functionality to get around this in my local copy.

I'm sure there is a way to discover which type of file is to be uploaded and work it accordingly. Also looping through multiple selected items at a time and passing them to dockhand would be doable. If i can grab some time I'd be willing add this. Sound ok?

Atom Version: 1.0.8 System: Mac OS X 10.10.5 Thrown From: Docksend package, v1.0.0

Stack Trace

Uncaught TypeError: Cannot read property 'isModified' of undefined

At /Users/Stuart/.atom/packages/Docksend/lib/docksend.coffee:20

TypeError: Cannot read property 'isModified' of undefined
    at Object.module.exports.Docksend.docksend (/Users/Stuart/.atom/packages/Docksend/lib/docksend.coffee:20:14)
    at atom-workspace.subscriptions.add.atom.commands.add.docksend:docksend (/Users/Stuart/.atom/packages/Docksend/lib/docksend.coffee:12:85)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
    at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)

Commands

     -0:00.7.0 docksend:docksend (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "one-dark-syntax"
    ]
  }
}

Installed Packages

# User
Docksend, v1.0.0
language-asp, v1.0.0
minimap, v4.13.2

# Dev
No dev packages
wesbaker commented 8 years ago

If i can grab some time I'd be willing add this. Sound ok?

Sounds good to me, it'll be a while before I can dig into it.