This repository has been archived by the owner. It is now read-only.

Uncaught TypeError: Cannot read property '0' of null #2

Closed
aaronsturm opened this Issue Feb 2, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@aaronsturm

aaronsturm commented Feb 2, 2016

[Enter steps to reproduce below:]

  1. Just installed this package.
  2. Placed my cursor on the function's name.
  3. Used the shortcut ctrl+alt+enter and this error occurred. It happens each time.

Atom Version: 1.4.2
System: Microsoft Windows 10 Pro
Thrown From: goto-definition package, v1.1.7

Stack Trace

Uncaught TypeError: Cannot read property '0' of null

At /C:/Users/Aaron/.atom/packages/goto-definition/lib/goto-definition.coffee:21

TypeError: Cannot read property '0' of null
    at Object.module.exports.getScanOptions (file:///C:/Users/Aaron/.atom/packages/goto-definition/lib/goto-definition.coffee:15:6)
    at Object.module.exports.go (file:///C:/Users/Aaron/.atom/packages/goto-definition/lib/goto-definition.coffee:34:23)
    at atom-text-editor.<anonymous> (file:///C:/Users/Aaron/.atom/packages/goto-definition/lib/goto-definition.coffee:7:8)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Aaron\AppData\Local\atom\app-1.4.2\resources\app.asar\src\command-registry.js:260:29)
    at C:\Users\Aaron\AppData\Local\atom\app-1.4.2\resources\app.asar\src\command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\Aaron\AppData\Local\atom\app-1.4.2\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\Aaron\AppData\Local\atom\app-1.4.2\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (C:\Users\Aaron\AppData\Local\atom\app-1.4.2\resources\app.asar\src\window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (C:\Users\Aaron\AppData\Local\atom\app-1.4.2\resources\app.asar\src\window-event-handler.js:3:61)

Commands

     -8:44 settings-view:open (atom-text-editor.editor.is-focused)
     -8:39.1.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -8:08.4.0 core:close (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
  2x -8:06.0 goto-definition:go (atom-text-editor.editor.is-focused)
     -6:28.9.0 settings-view:open (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -6:24.4.0 core:close (button.btn.icon.enablement.icon-playback-play)
     -5:25.6.0 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
     -5:25.4.0 editor:select-to-end-of-line (atom-text-editor.editor.is-focused)
     -5:24.5.0 core:copy (atom-text-editor.editor.is-focused)
     -4:39 find-and-replace:show (atom-text-editor.editor.is-focused)
  2x -4:36.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -4:24.8.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -4:24.8.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:23.1.0 settings-view:open (atom-text-editor.editor.is-focused)
     -0:03.2.0 goto-definition:go (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "disabledPackages": [
      "git-log"
    ],
    "ignoredNames": [
      ".git",
      ".sass-cache",
      ".idea"
    ],
    "projectHome": "C:\\Users\\Aaron\\Websites"
  }
}

Installed Packages

# User
aligner, v0.18.1
bottom-dock, v0.3.7
emmet, v2.4.1
file-icons, v1.6.14
goto-definition, v1.1.7
linter, v1.11.3
minimap, v4.19.0
minimap-autohide, v0.10.1
minimap-git-diff, v4.1.8
pigments, v0.22.1
todo-manager, v0.2.6
tree-view-git-modified, v0.6.2

# Dev
No dev packages
@faceair

This comment has been minimized.

Owner

faceair commented Feb 2, 2016

Thanks. I fixed it , but I have no windows device. Can you help me verify my patch is work ?
Just do this:

  1. open Settings-> Packages -> Goto Definition -> View Code
  2. replace lib/goto-definition.coffee line 15 to [_, project_name] = /[\/\\]([^\/^\\]+)$/.exec project_path, like this
  3. reload the window.
    If it work, I will release a new version.
@aaronsturm

This comment has been minimized.

aaronsturm commented Feb 2, 2016

Wow, thanks for the fast turnaround! That fixed it, thanks!

@faceair

This comment has been minimized.

Owner

faceair commented Feb 2, 2016

Cheers! 🍻

➜  atom-goto-definition git:(master)
apm publish 1.1.8
Preparing and tagging a new version ✓
Pushing v1.1.8 tag ✓
Publishing goto-definition@v1.1.8 ✓

@faceair faceair closed this Feb 2, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.