sindrets / atom-title-bar-replacer

Adds an alternative, theme-aware title bar and application menu that is more inline with Atom's UI design.
Other
85 stars 5 forks source link

Uncaught TypeError: Cannot read property 'innerHTML' of undefined #1

Closed rootasjey closed 7 years ago

rootasjey commented 7 years ago

Hello,

Sometimes, I've this error fired when I open a folder with Atom from Windows 10 context menu 'Open with Atom'. When this error occurs, the custom title bar becomes unresponsive (cannot click on menus) Closing the editor and re-opening it in the same way resolves the issue.

[Steps to reproduce:]

  1. Install 'atom-title-bar-replacer' plugin
  2. Run the 'Window frame remover'
  3. Close Atom and Open it again

Atom: 1.18.0 x64 Electron: 1.3.15 OS: Microsoft Windows 10 Enterprise Thrown From: title-bar-replacer package 1.1.0

Stack Trace

Uncaught TypeError: Cannot read property 'innerHTML' of undefined

At C:\Users\jct2\.atom\packages\title-bar-replacer\lib\title-bar-replacer-view.js:272

TypeError: Cannot read property 'innerHTML' of undefined
  at /packages/title-bar-replacer/lib/title-bar-replacer-view.js:290:29

Commands

     -0:17.2.0 tool-bar:position-left (atom-workspace.workspace.scrollbars-visible-always)
  2x -0:16 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.theme-pure-syntax.theme-atom-material-ui)

Non-Core Packages

activate-power-mode 2.0.0 
animated-page-scroll 1.0.1 
atom-bracket-highlight 0.3.2 
atom-css-comb 3.1.0 
atom-jasmine 0.8.1 
atom-material-syntax 1.0.6 
atom-material-syntax-light 0.4.6 
atom-material-ui 2.0.4 
atom-ternjs 0.18.3 
autocomplete-paths 1.0.5 
busy-signal 1.4.3 
cursor-scroll 1.0.1 
eclectic-syntax 0.2.1 
emerald-dream-syntax 0.2.3 
fairygloss 0.4.0 
ficus-syntax 2.0.0 
file-icons 2.1.7 
firewatch-syntax 1.1.1 
flat-ui-syntax 0.5.1 
flatwhite-syntax 0.8.1 
github-atom-dark-syntax 0.5.0 
github-atom-light-syntax 0.5.0 
gloom 0.6.4 
goto-definition 1.3.3 
highlight-selected 0.13.1 
hyperclick 0.0.40 
indent-guide-improved 1.4.12 
intentions 1.1.2 
js-hyperclick 1.11.0 
js-refactor 0.7.5 
linter 2.2.0 
linter-jscs 4.1.2 
linter-jshint 3.1.4 
linter-ui-default 1.6.2 
minimap 4.28.2 
minimap-autohide 0.10.1 
minimap-bookmarks 0.4.2 
minimap-codeglance 0.4.7 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
minimap-selection 4.4.0 
monokai 0.24.0 
nord-atom-syntax 0.9.1 
oceanic-next 1.0.0 
oceanic-reef-syntax 0.9.0 
outline-selection 0.3.1 
package-sync 1.1.0 
platformio-ide-terminal 2.5.1 
pure-syntax 0.2.1 
rain-syntax 2.0.2 
refactor 0.11.5 
scm 1.6.0 
title-bar-replacer 1.1.0 
todo-show 1.11.0 
tool-bar 1.1.0 
sindrets commented 7 years ago

Hello @rootasjey! Thank you for raising this issue. I've figured out what causes the issue and how to fix it. However, I'm out traveling at the moment and I won't be able to push a fix for about 2.5 weeks. I apologize for the inconvenience.

rootasjey commented 7 years ago

No problem, thank you for the quick answer.

sindrets commented 7 years ago

This bug is now fixed in v1.2.0 👍

skylize commented 6 years ago

I just got this same error message with 1.4.3.

I think maybe within this function

initTitleListener(titleSpan) {
    setInterval(function() {
    //...
  }
}

that this line

 if (title.innerHTML == undefined) return;

should just be

 if (title == undefined) return;

or else expanded to

 if (title == undefined || title.innerHTML == undefined) return;
sindrets commented 6 years ago

@skylize yes, I have already fixed this bug along with several other changes yet to be committed. However, from my experience, the error doesn't break any functionality, so I don't feel a rush to publish the changes yet. Thanks for the heads up though.