Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught TypeError: Cannot read property 'startsWith' of undefined #951

Description

@chenyinlong

Edited by @Ben3eeE to add steps to reproduce

  1. Right click on an untitled buffer
  2. Click on view unstaged changes or view staged changes

Note: There is a different exception now when doing these steps not the startsWith of undefined:

Uncaught (in promise) TypeError: Cannot read property 'toString' of undefined
    at Object.realpath (fs.js:1686:8)
    at Object.fs.realpath (ELECTRON_ASAR.js:338:25)
    at Promise (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app.asar\node_modules\universalify\index.js:13:12)
    at Promise (<anonymous>)
    at Object.defineProperty.value [as realpath] (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app.asar\node_modules\universalify\index.js:7:14)
    at C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:614:63
    at Generator.next (<anonymous>)
    at step (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:138:197)
    at C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:138:443
    at Promise (<anonymous>)
    at C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:138:105
    at RootController.viewChangesForCurrentFile (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:666:13)
    at RootController.viewStagedChangesForCurrentFile (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:674:16)
    at CommandRegistry.handleCommandEvent (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\command-registry.js:384:49)
    at CommandRegistry.dispatch (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\command-registry.js:273:23)
    at AtomEnvironment.dispatchContextMenuCommand (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\atom-environment.js:1351:25)
    at EventEmitter.outerCallback (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\application-delegate.js:346:53)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:197:7)

道中文是否可以???!
自己蹦出的错误,并不知道为什么
[Enter steps to reproduce:]

https://puu.sh/xn56P.gif

Atom: 1.18.0 x64
Electron: 1.3.15
OS: Ubuntu 16.04.2
Thrown From: github package 0.3.3

Stack Trace

Uncaught TypeError: Cannot read property 'startsWith' of undefined

At /usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:792

TypeError: Cannot read property 'startsWith' of undefined
    at RootController.viewChangesForCurrentFile (/usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:792:26)
    at RootController.viewUnstagedChangesForCurrentFile (/usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:812:16)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:265:35)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:3:65)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app/src/command-registry.js:166:25)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/usr/share/atom/resources/app/src/atom-environment.js:1320:34)
    at EventEmitter.outerCallback (/usr/share/atom/resources/app/src/application-delegate.js:347:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -6:23 vim-mode-plus:repeat-find-reverse (input.hidden-input)
     -6:14.7.0 vim-mode-plus:insert-after (input.hidden-input)
  2x -6:14.3.0 editor:newline (input.hidden-input)
     -6:12.5.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
     -6:09.6.0 vim-mode-plus:repeat-find-reverse (input.hidden-input)
     -6:08.7.0 vim-mode-plus:substitute (input.hidden-input)
  2x -6:07.6.0 core:backspace (input.hidden-input)
     -6:07.2.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
 47x -5:24.4.0 vim-mode-plus:move-down (input.hidden-input)
 38x -5:22.3.0 vim-mode-plus:move-up (input.hidden-input)
     -0:20.5.0 vim-mode-plus:move-down (input.hidden-input)
 15x -0:20.3.0 vim-mode-plus:move-up (input.hidden-input)
 14x -0:18.8.0 vim-mode-plus:move-down (input.hidden-input)
 11x -0:17.6.0 vim-mode-plus:move-up (input.hidden-input)
     -0:16.5.0 vim-mode-plus:move-down (input.hidden-input)
     -0:15.8.0 github:view-unstaged-changes-for-current-file (div.lines)

Non-Core Packages

atom-beautify 0.30.1 
atom-react-autocomplete 0.1.10 
atom-ternjs 0.18.3 
autocomplete-js-import 1.4.0 
autocomplete-paths 1.0.5 
autoprefixer 3.7.0 
busy-signal 1.4.3 
color-picker 2.2.5 
emmet 2.4.3 
emmet-jsx-css-modules 1.0.0 
file-icons 2.1.7 
file-types 0.5.5 
git-plus 7.9.3 
intentions 1.1.2 
language-babel 2.66.0 
language-javascript-jsx 0.3.7 
linter 2.2.0 
linter-htmlhint 1.3.3 
linter-jshint 3.1.2 
linter-sass-lint 1.7.4 
linter-ui-default 1.6.1 
platformio-ide-terminal 2.5.1 
react-es6-snippets 0.3.0 
react-snippets 0.8.0 
relative-numbers 0.8.0 
vim-mode-plus 0.93.0 

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions