guiguan / file-header

FileHeader for Atom
https://atom.io/packages/file-header
Other
31 stars 21 forks source link

Uncaught TypeError: Cannot read property 'getBaseName' of null #34

Closed 5h3rr1ll closed 7 years ago

5h3rr1ll commented 7 years ago

[Enter steps to reproduce:]

  1. opened a new tab, the tab didn't became automatically a header, so I made a secondary click to choose File Header -> add header
  2. since the header did't appear, I choose that menu point again vor 1 or 2 times, than the error appears.

Hope that helps.

Cheers!

Atom: 1.14.4 x64 Electron: 1.3.13 OS: Mac OS X 10.11.6 Thrown From: file-header package 1.13.2

Stack Trace

Uncaught TypeError: Cannot read property 'getBaseName' of null

At /Users/jiGg4/.atom/packages/file-header/lib/file-header.coffee:246

TypeError: Cannot read property 'getBaseName' of null
    at Object.getNewHeader (/packages/file-header/lib/file-header.coffee:246:132)
    at Object.addHeader (/packages/file-header/lib/file-header.coffee:323:32)
    at Object.add (/packages/file-header/lib/file-header.coffee:365:6)
    at /packages/file-header/lib/file-header.coffee:167:30)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:3:59)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/app.asar/src/atom-environment.js:1170:28)
    at EventEmitter.outerCallback (/app.asar/src/application-delegate.js:333:25)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

  3x -5:43.6.0 core:backspace (input.hidden-input)
     -5:36.1.0 autocomplete-plus:cancel (input.hidden-input)
     -5:34.5.0 core:save (input.hidden-input)
  8x -5:04.4.0 core:backspace (input.hidden-input)
     -5:01.5.0 autocomplete-plus:confirm (input.hidden-input)
     -5:01.0 core:save (input.hidden-input)
  3x -2:55.5.0 core:backspace (input.hidden-input)
  2x -2:48.9.0 core:undo (input.hidden-input)
     -1:07.2.0 core:select-all (input.hidden-input)
     -1:03.0 core:backspace (input.hidden-input)
     -0:23.9.0 file-header:add (div.lines)
     -0:21.2.0 encoding-selector:show (atom-text-editor.editor)
     -0:17.9.0 core:confirm (input.hidden-input)
     -0:15.3.0 grammar-selector:show (atom-text-editor.editor)
     -0:13.6.0 core:confirm (input.hidden-input)
     -0:08.1.0 file-header:add (div.)

Non-Core Packages

autocomplete-python 1.8.57 
file-header 1.13.2 
kite 0.11.0 
platformio-ide-terminal 2.4.0 
script 3.14.1 
terminal-plus 0.14.5 
EGaraldi commented 7 years ago

Same here (file-header version 1.13.3). As a temporary workaround, you can disable the 'Enable Filename' option, which triggers the error.

guiguan commented 7 years ago

Thanks for reporting this issue, which has been fixed in v1.13.4