morassman/process-palette

Uncaught TypeError: Cannot read property 'text' of null

l-cornelius-dol opened this issue · 2 comments

Steps to reproduce:

  1. Tried to launch a process.

Atom: 1.36.1 x64
Electron: 2.0.18
OS: Microsoft Windows 10 Pro
Thrown From: process-palette package 0.17.0

Stack Trace

Uncaught TypeError: Cannot read property 'text' of null

At C:\<redacted>\atom\app-1.36.1\resources\app\static\<embedded>:11

TypeError: Cannot read property 'text' of null
    at TreeSitterLanguageMode.tokenForPosition (~/AppData/Local/atom/app-1.36.1/resources/app/static/<embedded>:11:3085193)
    at TextEditor.tokenForBufferPosition (~/AppData/Local/atom/app-1.36.1/resources/app/static/<embedded>:11:45164)
    at ProcessController.module.exports.ProcessController.runProcessWithFile (/packages/process-palette/lib/controllers/process-controller.coffee:105:22)
    at ConfigController.module.exports.ConfigController.runProcessWithFile (/packages/process-palette/lib/controllers/config-controller.coffee:184:23)
    at ConfigController.module.exports.ConfigController.runProcess (/packages/process-palette/lib/controllers/config-controller.coffee:172:6)
    at /packages/process-palette/lib/controllers/config-controller.coffee:1:1)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.36.1/resources/app/static/<embedded>:11:350065)
    at KeymapManager.t.exports.KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.36.1/resources/app/static/<embedded>:11:1212791)
    at KeymapManager.t.exports.KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.36.1/resources/app/static/<embedded>:11:1208925)
    at WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.36.1/resources/app/static/<embedded>:11:285300)

Commands

     -2:00.4.0 find-and-replace:focus-next (input.hidden-input)
     -1:59.8.0 core:backspace (input.hidden-input)
     -1:58.4.0 find-and-replace:focus-next (input.hidden-input)
     -1:58 core:backspace (input.hidden-input)
     -1:52.4.0 project-find:confirm (input.hidden-input)
     -1:41.2.0 core:cancel (div.results-view.focusable-panel)
     -1:38.6.0 core:close (div.results-view.focusable-panel)
  2x -1:37.5.0 editor:move-to-first-character-of-line (input.hidden-input)
  2x -1:36.6.0 core:move-down (input.hidden-input)
     -1:31.7.0 project-find:show (input.hidden-input)
     -1:26.3.0 core:confirm (input.hidden-input)
     -1:24.6.0 core:cancel (div.results-view.focusable-panel)
     -1:23.7.0 core:close (div.results-view.focusable-panel)
     -1:22.8.0 editor:move-to-first-character-of-line (input.hidden-input)
 34x -1:22.2.0 core:move-down (input.hidden-input)
     -0:27.2.0 process-palette:create-folder (input.hidden-input)

Non-Core Packages

atom-overtype-mode 0.4.0 
autosave-onchange 1.5.1 
block-comment 0.4.3 
color-picker 2.3.0 
column-select 1.0.1 
css-declaration-sorter 1.2.3 
ctrl-dir-scroll 0.2.5 
file-templates 0.2.0 
highlight-line 0.12.0 
justright-latte-syntax 0.1.0 
justright-latte-ui 0.1.0 
language-batchfile 0.7.5 
language-ini 1.20.0 
markdown-preview-plus 3.8.1 
multi-cursor-plus 1.2.0 
pigments 0.40.2 
process-palette 0.17.0 
project-manager 3.3.7 
sort-lines 0.19.0 
sync-settings 0.8.6 
tree-view-auto-collapse 1.0.2 
tree-view-sort 0.11.3 

This appears to be replicated with:

  1. A file named test.js
  2. Content of one blank line and a comment line
  3. Place cursor on first line, and
  4. Invoke the a command by hotkey or via the menu.

The underlying command does not launch, nor does the results/progress pane display.

It does not happen with a Java source file with a similar blank line, and it does not happen if the cursor is not on the first line.

2019-06-06 15_30_25-Test js — Atom

Appears to be fixed now.