Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'replace' of null #10

Open
ZeroDot1 opened this issue Jun 26, 2019 · 3 comments
Open

Uncaught TypeError: Cannot read property 'replace' of null #10

ZeroDot1 opened this issue Jun 26, 2019 · 3 comments

Comments

@ZeroDot1
Copy link

ZeroDot1 commented Jun 26, 2019

[Enter steps to reproduce:]

  1. Right click -> Sort

Atom: 1.38.2 x64
Electron: 4.1.4
OS: linux 5.1.15-arch1-1-ARCH
Thrown From: sorter package 1.3.0

Stack Trace

Uncaught TypeError: Cannot read property 'replace' of null

At /usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:1319

TypeError: Cannot read property 'replace' of null
    at TextBuffer.setTextInRange (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:859:27)
    at newRange.transact (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:846:49)
    at TextBuffer.transact (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:1316:16)
    at TextBuffer.setTextInRange (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:846:29)
    at TextEditor.setTextInBufferRange (/usr/lib/atom/src/text-editor.js:1364:29)
    at getRanges.forEach.range (/packages/sorter/source/index.js:54:10)
    at Array.forEach (<anonymous>)
    at sort (/packages/sorter/source/index.js:53:27)
    at /packages/sorter/source/index.js:37:25)
    at CommandRegistry.handleCommandEvent (/usr/lib/atom/src/command-registry.js:384:43)
    at CommandRegistry.dispatch (/usr/lib/atom/src/command-registry.js:273:17)
    at AtomEnvironment.dispatchContextMenuCommand (/usr/lib/atom/src/atom-environment.js:1383:19)
    at EventEmitter.outerCallback (/usr/lib/atom/src/application-delegate.js:305:47)
    at EventEmitter.emit (events.js:182:13)

Commands

     -2:31.3.0 application:add-project-folder (ol.tree-view-root.full-menu.list-tree.has-collapsable-children.focusable-panel)
  2x -2:12.4.0 editor:newline (input.hidden-input)
     -2:10.1.0 core:paste (input.hidden-input)
     -2:09.0 core:move-up (input.hidden-input)
     -2:05.8.0 core:paste (input.hidden-input)
  2x -1:55.4.0 sorter:sort (div.line)
     -1:47.2.0 duplicate-removal:toggle (div.line)
     -1:36.7.0 window:save-all (input.hidden-input)
     -0:35.5.0 editor:newline (input.hidden-input)
     -0:30.5.0 core:paste (input.hidden-input)
     -0:29.8.0 editor:newline (input.hidden-input)
     -0:28.3.0 core:paste (input.hidden-input)
     -0:21.9.0 sorter:sort (div.line)
     -0:19.9.0 duplicate-removal:toggle (div.line)
     -0:15.1.0 window:save-all (input.hidden-input)

Non-Core Packages

atom-beautify 0.33.4 
atom-file-icons 0.7.1 
duplicate-removal 0.1.3 
scroll-color 0.3.0 
sorter 1.3.0 
@FlorianWendelborn
Copy link
Owner

@ZeroDot1 Please fill out the enter steps to reproduce section.

@ZeroDot1
Copy link
Author

ZeroDot1 commented Jan 17, 2020

Steps to reproduce done.

  • Right click -> Sort

#11

@FlorianWendelborn
Copy link
Owner

FlorianWendelborn commented Jan 17, 2020

@ZeroDot1, is it possible that you didn’t select any text? There’d be nothing (probably where your null comes from) to sort then. IIRC, atom-sorter never supported sorting the entire file without selecting it first. Since I’ve switched to vscode, I probably won’t fix that. However, I’d accept a PR and publish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants