atom: Uncaught TypeError: Cannot read property 'onDidChangeIcon' of null

Steps to reproduce

Not sure, what exactly causes this erroneous application state. However, once the application enters it, clicking to expand some directories in the file tree causes this error to be thrown. I assume that it happens while trying to get the icon for the files in said directory. Because of the error, it is not possible to see the files in that directory.

In the instance that I’m experiencing right now there is only one file (.yaml) in the problematic directory, no sub folders.

This might have something to do with changes git branches which add new directories. This error only started occurring a couple of days ago.

Other

Atom: 1.23.2 x64 Electron: 1.6.15 OS: Ubuntu 16.04.3 Thrown From: file-icons package 2.1.16

Stack Trace

Uncaught TypeError: Cannot read property ‘onDidChangeIcon’ of null

At /home/arek/.atom/packages/file-icons/lib/service/icon-node.js:30

TypeError: Cannot read property 'onDidChangeIcon' of null
    at /packages/file-icons/lib/service/icon-node.js:30:12)
    at Function.forElement (/packages/file-icons/lib/service/icon-node.js:177:17)
    at /packages/file-icons/lib/service/icon-service.js:90:31)
    at IconServices.updateFileIcon (/usr/share/atom/resources/app/node_modules/tree-view/lib/get-icon-services.js:85:37)
    at FileView.module.exports.FileView.updateIcon (/usr/share/atom/resources/app/node_modules/tree-view/lib/file-view.js:45:31)
    at new FileView (/usr/share/atom/resources/app/node_modules/tree-view/lib/file-view.js:30:18)
    at DirectoryView.module.exports.DirectoryView.createViewForEntry (/usr/share/atom/resources/app/node_modules/tree-view/lib/directory-view.js:135:22)
    at /usr/share/atom/resources/app/node_modules/tree-view/lib/directory-view.js:108:32
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at Directory.module.exports.Directory.reload (/usr/share/atom/resources/app/node_modules/tree-view/lib/directory.js:395:35)
    at Directory.module.exports.Directory.expand (/usr/share/atom/resources/app/node_modules/tree-view/lib/directory.js:408:18)
    at DirectoryView.module.exports.DirectoryView.expand (/usr/share/atom/resources/app/node_modules/tree-view/lib/directory-view.js:174:30)
    at DirectoryView.module.exports.DirectoryView.toggleExpansion (/usr/share/atom/resources/app/node_modules/tree-view/lib/directory-view.js:160:27)
    at TreeView.module.exports.TreeView.entryClicked (/usr/share/atom/resources/app/node_modules/tree-view/lib/tree-view.js:615:30)
    at HTMLDivElement.<anonymous> (/usr/share/atom/resources/app/node_modules/tree-view/lib/tree-view.js:351:32)

Commands

     -2:39 intentions:highlight (input.hidden-input)
     -2:38.5.0 core:close (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.9 
atom-build-waf 0.2.0 
autocomplete-ctags 0.4.1 
build 0.70.0 
busy 0.7.0 
busy-signal 1.4.3 
dbg 1.6.3 
dbg-gdb 1.7.8 
docblockr 0.13.6 
editorconfig 2.2.2 
file-icons 2.1.16 
file-types 0.5.5 
git-plus 7.10.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-cmake 1.1.0 
language-cpp14 0.6.2 
language-cuda 0.1.0 
language-diff 0.7.0 
language-doxygen 0.3.0 
language-jade 0.7.2 
language-matlab 0.2.1 
linter 2.2.0 
linter-clang 4.1.2 
linter-ui-default 1.6.10 
minimap 4.29.7 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
minimap-linter 2.1.3 
output-panel 0.3.4 
platformio-ide-terminal 2.8.0 
sync-settings 0.8.3 
tree-view-git-status 1.4.0 
tree-view-open-files 0.3.0 

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 21 (9 by maintainers)

Most upvoted comments

This actually shouldn’t be happening. Period.

I’ll try to have a look at it sometime late this week (probably Friday). 😞 Sorry this is happening.

Gonna roll a release soon anyway, so you won’t see this issue even if it is a fluke. =)

@sylvanr Are you saying you’re still witnessing this issue even after installing the latest version of both file-icons and Atom?

If so, could you please tell me what packages and themes are installed? Note what I said before about switching off IO in the package’s settings.

Same problem, different setup. In my case, atom was in focus. I deleted a directory with the permanent-delete package and then built using build-scons. When I tried to look into the build directory, this error popped up.

Known workaround: restart atom. Reloading via <kbd>Ctrl+Shift+F5</kbd> seems to work too, although I think I remember one occasion where a simple reload didn’t.