abe33 / atom-tree-view-breadcrumb

Display a breadcrumb on tree view scroll
MIT License
10 stars 3 forks source link

Uncaught TypeError: Cannot read property 'top' of undefined #13

Closed kankaristo closed 9 years ago

kankaristo commented 9 years ago

I'm not sure if this is a bug in tree-view-breadcrumb or tree-view.

The "View Issue" button actually directs me here: https://github.com/atom/tree-view/issues/338, but that seems like an entirely different issue.

Here's the stack trace:

TypeError: Cannot read property 'top' of undefined
  at TreeView.module.exports.TreeView.scrollToEntry (/usr/share/atom/resources/app.asar/node_modules/tree-view/lib/tree-view.js:1078:38)
  at tree-view-breadcrumb.BreadcrumbElement.attach (/home/sami/.atom/packages/tree-view-breadcrumb/lib/breadcrumb-element.coffee:93:31)
  at tree-view-breadcrumb.BreadcrumbElement.show (/home/sami/.atom/packages/tree-view-breadcrumb/lib/breadcrumb-element.coffee:81:6)
  at tree-view-breadcrumb.BreadcrumbElement.subscribeToTreeView (/home/sami/.atom/packages/tree-view-breadcrumb/lib/breadcrumb-element.coffee:68:6)
  at /home/sami/.atom/packages/tree-view-breadcrumb/lib/breadcrumb-element.coffee:54:8

This comes up from time to time when opening a new Atom window, but not always.

abe33 commented 9 years ago

@kankaristo no you're at the right place, can you tell me a bit about the context in which it happened, the stack says it occured on attachment, but what was the content of the tree-view at that point, as it seems it can't find a selected element.

kankaristo commented 9 years ago

It happens quite rarely, and I can't find a way to reproduce it right now...

I'll collect as much info as I can the next time it happens.

abe33 commented 9 years ago

My guess is that there' probably no selection in the tree-view when it occurs, but I would like to confirm that if possible.

eboracus commented 9 years ago

Yes this does seem to occur when there is no selection in the tree view. At least I've seen it when disabling and then re-enabling the package in the settings view (hence no selection active in the tree view). But when disabling and then re-enabling manually using the config.cson file and with this file selected in the tree view the error doesn't occur. Using config.cson with the file not selected in the tree view (i.e. the .atom/ folder not included as a project folder) the error occurs as before.