sfaedo / auto-reveal-active-file

Auto reveal the current active file in the tree view on Atom editor
MIT License
3 stars 1 forks source link

Uncaught TypeError: Cannot read property 'isVisible' of undefined #6

Open devnigam24 opened 7 years ago

devnigam24 commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.17.2 x64 Electron: 1.3.15 OS: Mac OS X 10.12.3 Thrown From: auto-reveal-active-file package 0.3.1

Stack Trace

Uncaught TypeError: Cannot read property 'isVisible' of undefined

At /Users/dnigam/.atom/packages/auto-reveal-active-file/lib/auto-reveal-active-file.js:13

TypeError: Cannot read property 'isVisible' of undefined
    at /packages/auto-reveal-active-file/lib/auto-reveal-active-file.js:13:61
    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 Workspace.didChangeActivePaneItemOnPaneContainer (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:489:1)
    at WorkspaceCenter.paneContainer.onDidChangeActivePaneItem (/Applications/Atom.app/Contents/Resources/app/src/workspace-center.js:16:1)
    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 PaneContainer.didChangeActiveItemOnPane (/Applications/Atom.app/Contents/Resources/app/src/pane-container.js:280:1)
    at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:318:1)
    at Pane.module.exports.Pane.activateItemAtIndex (/Applications/Atom.app/Contents/Resources/app/src/pane.js:454:1)
    at Pane.module.exports.Pane.activatePreviousItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:419:1)
    at Pane.module.exports.Pane.removeItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:609:1)
    at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:685:1)
    at TabBarView.module.exports.TabBarView.closeTab (/Applications/Atom.app/Contents/Resources/app/node_modules/tabs/lib/tab-bar-view.js:339:1)
    at HTMLDivElement.TabView.didClickCloseIcon (/Applications/Atom.app/Contents/Resources/app/node_modules/tabs/lib/tab-bar-view.js:227:1)

Commands

Non-Core Packages

atom-beautify 0.29.26 
auto-reveal-active-file 0.3.1 
Samuel1989 commented 6 years ago

I hit this problem too, I think it is when you open Atom when tree view isn't loaded and/or available.

I have thrown in a quick fix to just check that the tree view object is available before call "isVisible" and submitted a pull request: https://github.com/sfaedo/auto-reveal-active-file/pull/8

Seems to work :P

Sam