tualo / tualo-git-context

Git context menu for atom
MIT License
2 stars 0 forks source link

Uncaught TypeError: Cannot read property 'getWorkingDirectory' of null #31

Closed oleoneto closed 7 years ago

oleoneto commented 7 years ago

[Enter steps to reproduce:]

  1. Add Project Folder
  2. Start atom-live-server
  3. Change project folder contents (in my case, an HTML page)

Atom: 1.17.2 x64 Electron: 1.3.15 OS: Mac OS X 10.12.5 Thrown From: tualo-git-context package 0.6.18

Stack Trace

Uncaught TypeError: Cannot read property 'getWorkingDirectory' of null

At /Applications/Atom.app/Contents/Resources/app/src/pane.js:1095

TypeError: Cannot read property 'getWorkingDirectory' of null
    at /packages/tualo-git-context/lib/tualo-git-context-view.coffee:78:64
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:1)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:1)
    at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1142:1)
    at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1108:1)
    at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:925:1)
    at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:780:1)
    at Pane.saveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:3:1)
    at Pane.module.exports.Pane.saveActiveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:763:1)
    at Workspace.saveActivePaneItem (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:1498:1)
    at atom-workspace.core:save (/Applications/Atom.app/Contents/Resources/app/src/register-default-commands.js:236:1)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:265:1)
    at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:1
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:1)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:1)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:100:1)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:3:1)

Commands

     -2:20.2.0 core:move-left (input.hidden-input)
     -2:17.8.0 core:backspace (input.hidden-input)
  4x -2:17.3.0 core:save (input.hidden-input)
     -1:54 core:backspace (input.hidden-input)
  3x -1:53.7.0 core:save (input.hidden-input)
     -1:36.5.0 tree-view:remove-project-folder (span.name.icon.icon-file-directory)
     -1:30.1.0 application:add-project-folder (input.hidden-input)
     -0:59.7.0 atom-live-server:startServer (input.hidden-input)
     -0:31.4.0 core:save (input.hidden-input)
     -0:19.8.0 emmet:insert-formatted-line-break-only (input.hidden-input)
     -0:19.8.0 editor:newline (input.hidden-input)
     -0:17.7.0 emmet:insert-formatted-line-break-only (input.hidden-input)
     -0:17.6.0 editor:newline (input.hidden-input)
     -0:12.9.0 emmet:insert-formatted-line-break-only (input.hidden-input)
     -0:12.9.0 editor:newline (input.hidden-input)
     -0:12.3.0 core:save (input.hidden-input)

Non-Core Packages

angular2-component-generator 0.0.1 
atom-html-templates 0.1.3 
atom-live-server 2.1.2 
atom-lorempixel 0.1.0 
atom-password-generator 0.2.2 
atomify 0.3.0 
dash 1.7.1 
emmet 2.4.3 
Hydrogen 1.12.1 
nord-atom-ui 0.11.0 
pigments 0.39.1 
react-generatr 1.0.0 
snippet-generator 0.3.2 
tualo-git-context 0.6.18 
zentabs 0.8.8 
thomashoffmann1979 commented 7 years ago

Hi, thank you for reporting. There was a not checked return value. I fixed this in version 0.6.19. I was not able to test it, because atom-live-server seem not to work no my system.

oleoneto commented 7 years ago

Sure, thanks for the feedback! I also noticed that this only happened when I opened a project from an external storage device. Moving the project folder to the system's main disk fixed the error. Thanks, again!