ericcornelissen/pinned-tabs-for-atom

Uncaught TypeError: Cannot read property 'querySelector' of null

Closed this issue · 4 comments

[Enter steps to reproduce below:]

  1. ...
  2. ...

Not sure, I did 'Close other tabs', but I'm not sure if I had pinned tabs

Atom Version: 1.8.0
System: "Fedora release
Thrown From: pinned-tabs package, v0.3.1

Stack Trace

Uncaught TypeError: Cannot read property 'querySelector' of null

At /home/vrutkovs/.atom/packages/pinned-tabs/lib/pinned-tabs.coffee:96

TypeError: Cannot read property 'querySelector' of null
    at /home/vrutkovs/.atom/packages/pinned-tabs/lib/pinned-tabs.coffee:96:34
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib64/atom/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/lib64/atom/node_modules/event-kit/lib/emitter.js:125:28)
    at PaneContainer.module.exports.PaneContainer.willDestroyPaneItem (/usr/lib64/atom/src/pane-container.js:298:27)
    at Pane.module.exports.Pane.destroyItem (/usr/lib64/atom/src/pane.js:630:17)
    at atom-tabs.TabBarView.closeTab (/usr/lib64/atom/node_modules/tabs/lib/tab-bar-view.js:321:26)
    at atom-tabs.TabBarView.closeOtherTabs (/usr/lib64/atom/node_modules/tabs/lib/tab-bar-view.js:385:30)
    at Object.addElementCommands.tabs:close-other-tabs (/usr/lib64/atom/node_modules/tabs/lib/tab-bar-view.js:100:26)
    at atom-tabs.commandsWithPropagationStopped.(anonymous function) (/usr/lib64/atom/node_modules/tabs/lib/tab-bar-view.js:86:36)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/lib64/atom/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/usr/lib64/atom/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/lib64/atom/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/usr/lib64/atom/src/atom-environment.js:1106:28)
    at EventEmitter.outerCallback (/usr/lib64/atom/src/application-delegate.js:340:25)
    at emitThree (events.js:110:13)
    at EventEmitter.emit (events.js:188:7)

Commands

  4x -0:16 tree-view:reveal-active-file (atom-workspace.workspace.scrollbars-visible-always.seti-ui-no-icons.theme-monokai.theme-one-dark-ui)
     -0:00.8.0 tabs:close-other-tabs (li.texteditor.tab.sortable.active.right-clicked)

Config

{
  "core": {
    "audioBeep": false,
    "closeEmptyWindows": false,
    "disabledPackages": [
      "language-python",
      "tab-title",
      "autohide-tree-view",
      "autocomplete-plus"
    ],
    "projectHome": "/home/vrutkovs/src",
    "themes": [
      "one-dark-ui",
      "monokai"
    ]
  }
}

Installed Packages

# User
MagicPython, v0.5.13
atom-notifier, v0.5.1
custom-title, v1.0.1
dockerletion, v0.2.0
file-icons, v1.7.17
indent-guide-improved, v1.4.9
language-cmake, v0.2.0
language-docker, v1.1.6
language-gherkin, v1.0.4
language-groovy, v0.6.0
language-mako, v0.6.0
language-spec, v0.1.0
linter, v1.11.14
linter-flake8, v1.13.2
merge-conflicts, v1.4.4
monokai, v0.18.0
pinned-tabs, v0.3.1
synced-sidebar, v0.4.3

# Dev
No dev packages

I got the same problem

  1. Opened Atom with 3 Tabs open, no pinned tab
  2. Middle-Mouse-Click on the first tab to close it
  3. Error Occurs

Atom Version: 1.11.0-dev-ac75135
Electron Version: 0.37.8
System: Debian GNU/Linux
Thrown From: pinned-tabs package, v0.3.1

Stack Trace

Uncaught TypeError: Cannot read property 'querySelector' of null

At /home/<user>/.atom/packages/pinned-tabs/lib/pinned-tabs.coffee:96

TypeError: Cannot read property 'querySelector' of null
    at /home/<user>/.atom/packages/pinned-tabs/lib/pinned-tabs.coffee:96:34
    at Function.module.exports.Emitter.simpleDispatch (/usr/local/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/local/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at PaneContainer.module.exports.PaneContainer.willDestroyPaneItem (/usr/local/share/atom/resources/app.asar/src/pane-container.js:298:27)
    at Pane.module.exports.Pane.destroyItem (/usr/local/share/atom/resources/app.asar/src/pane.js:632:17)
    at atom-tabs.TabBarView.onMouseDown (/usr/local/share/atom/resources/app.asar/node_modules/tabs/lib/tab-bar-view.js:671:19)

Commands

     -6:03.0 project-manager:list-projects (atom-text-editor.editor.is-focused)
     -6:01.2.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -5:46 git-plus:menu (atom-text-editor.editor.is-focused)
  2x -5:45.1.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -5:43.9.0 git-plus:menu (atom-text-editor.editor.is-focused)
     -5:42.6.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -5:41.7.0 git-plus:menu (atom-text-editor.editor.is-focused)
  2x -5:40.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -5:36.6.0 git-plus:menu (atom-text-editor.editor.is-focused)
  2x -5:35.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "automaticallyUpdate": false,
    "disabledPackages": [
      "autosave",
      "welcome",
      "package-generator",
      "open-on-github",
      "bookmarks",
      "tool-bar",
      "flex-tool-bar",
      "activate-power-mode",
      "quick-file-actions"
    ],
    "ignoredNames": [
      ".git",
      ".coverage",
      "tags",
      "composer.*",
      ".tags_swap",
      "tmp"
    ],
    "packagesWithKeymapsDisabled": [
      "atom-beautify",
      "tool-bar",
      "linter",
      "atom-dark-ui",
      "highlight-line",
      "last-cursor-position",
      "phpunit",
      "php-debug"
    ],
    "projectHome": "/home/<user>/dev",
    "themes": [
      "atom-material-ui",
      "afterglow-like"
    ]
  }
}

Installed Packages

# User
accents-ui, v1.2.0 (inactive)
afterglow-like, v0.2.1 (active)
afterglow-monokai-syntax, v1.3.4 (inactive)
afterglow-plus, v1.6.0 (inactive)
atom-beautify, v0.29.10 (inactive)
atom-material-ui, v1.3.3 (active)
color-picker, v2.2.2 (active)
composer, v0.5.0 (inactive)
docblockr, v0.7.4 (active)
file-icons, v1.7.18 (active)
git-plus, v5.16.2 (active)
git-time-machine, v1.5.3 (inactive)
highlight-line, v0.11.1 (active)
isotope-ui, v2.7.1 (inactive)
json-converter, v0.2.4 (inactive)
keyboard-localization, v1.4.18 (active)
last-cursor-position, v0.9.0 (active)
linter, v1.11.15 (active)
linter-php, v1.2.0 (active)
merge-conflicts, v1.4.4 (active)
minimap, v4.24.7 (active)
minimap-git-diff, v4.3.1 (active)
php-cs-fixer, v2.5.9 (active)
php-debug, v0.2.3 (active)
phpunit, v1.2.0 (active)
pigments, v0.31.2 (active)
pinned-tabs, v0.3.1 (active)
project-manager, v2.9.7 (active)
seti-ui, v1.3.2 (inactive)
seti-ui-red, v0.13.0 (inactive)
sync-settings, v0.7.2 (active)
tree-view-git-status, v1.1.0 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.5.0 (inactive)
one-light-ui, v1.5.0 (inactive)
one-dark-syntax, v1.3.0 (inactive)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.6.0 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (inactive)
background-tips, v0.26.1 (active)
bookmarks, v0.41.1 (inactive)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.38.3 (active)
find-and-replace, v0.201.0 (inactive)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.2 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (active)
notifications, v0.65.0 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.241.1 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.0 (inactive)
tabs, v0.100.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.208.2 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (inactive)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.2 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.42.1 (active)
language-html, v0.45.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.2 (active)
language-less, v0.29.5 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.2 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.69.0 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.56.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.23.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.9 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages

Thx for reporting! Since it doesn't appear to happen when there are tabs pinned (and that is what this code checks) I simply added a line that returns if that variable is null.

Same problem here, Do you have a work around?

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.21.1 x64
Electron: 1.6.15
OS: Microsoft Windows 10 Home
Thrown From: pinned-tabs package 1.3.0

Stack Trace

Uncaught TypeError: Cannot read property 'querySelector' of null

At C:\Users\Francois Lorrain\.atom\packages\pinned-tabs\lib\pinned-tabs.coffee:184

TypeError: Cannot read property 'querySelector' of null
    at Object.closeUnpinnedTabs (/packages/pinned-tabs/lib/pinned-tabs.coffee:184:24)
    at /packages/pinned-tabs/lib/pinned-tabs.coffee:81:75)
    at CommandRegistry.handleCommandEvent (C:/atom/app-1.21.1/resources/app/src/command-registry.js:381:36)
    at CommandRegistry.dispatch (C:/atom/app-1.21.1/resources/app/src/command-registry.js:266:23)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (C:/atom/app-1.21.1/resources/app/src/atom-environment.js:1354:34)
    at EventEmitter.outerCallback (C:/atom/app-1.21.1/resources/app/src/application-delegate.js:348:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

  3x -3:59.9.0 pinned-tabs:close-unpinned (li.texteditor.tab.sortable.active.right-clicked)

Non-Core Packages

autocomplete-python 1.10.3 
busy-signal 1.4.3 
editorconfig 2.2.2 
git-blame 1.3.1 
git-plus 7.10.0 
git-time-machine 1.5.9 
highlight-selected 0.13.1 
intentions 1.1.5 
language-batch 0.4.0 
language-liquid 0.6.0 
linter 2.2.0 
linter-ui-default 1.6.10 
merge-conflicts 1.4.5 
minimap 4.29.7 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
multi-cursor 2.1.5 
pinned-tabs 1.3.0 
platformio-ide-terminal 2.7.0 
process-palette 0.15.1 
script 3.17.3 
sublime-block-comment 0.5.1 
Sublime-Style-Column-Selection 1.7.4 
sublime-word-navigation 0.2.0 

@FrancoisLorrain, do you have any Markdown preview tabs, Settings tab or About tab open when the error occurs?