Github: Uncaught TypeError: Cannot read property 'isChanged' of undefined

Created on 29 May 2017  路  18Comments  路  Source: atom/github

[Enter steps to reproduce:]

  1. Make some differences in your file (remove a few lines)
  2. Open your file in Unstaged Changes mode
  3. Right mouse click on one of your deleted lines - Discard Selection
  4. Right mouse click on another deleted line - error appears

Atom: 1.18.0-beta2 x64
Electron: 1.3.15
OS: Microsoft Windows 10 Enterprise N 2015 LTSB
Thrown From: github package 0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'isChanged' of undefined

At C:\Users\user\AppData\Local\atom\app-1.18.0-beta2\resources\app\node_modules\github\lib\views\file-patch-selection.js:32

TypeError: Cannot read property 'isChanged' of undefined
    at Object.isItemSelectable (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/file-patch-selection.js:32:109)
    at ListSelection.isItemSelectable (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/list-selection.js:80:31)
    at ListSelection.getSelectedItems (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/list-selection.js:278:24)
    at FilePatchSelection.getSelectedLines (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/file-patch-selection.js:331:40)
    at FilePatchSelection.getSelectedHunks (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/file-patch-selection.js:259:40)
    at FilePatchView.render (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/file-patch-view.js:108:54)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:799:36)
    at ReactCompositeComponentWrapper._renderValidatedComponent (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:822:38)
    at ReactCompositeComponentWrapper._updateRenderedComponent (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:746:42)
    at ReactCompositeComponentWrapper._performComponentUpdate (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:724:16)
    at ReactCompositeComponentWrapper.updateComponent (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:645:18)
    at ReactCompositeComponentWrapper.performUpdateIfNecessary (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:561:18)
    at Object.performUpdateIfNecessary (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactReconciler.js:157:28)
    at runBatchedUpdates (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactUpdates.js:150:27)
    at ReactReconcileTransaction.perform (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/Transaction.js:140:26)
    at ReactUpdatesFlushTransaction.perform (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/Transaction.js:140:26)
    at ReactUpdatesFlushTransaction.perform (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactUpdates.js:89:38)
    at Object.flushBatchedUpdates (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactUpdates.js:172:25)
    at ReactDefaultBatchingStrategyTransaction.closeAll (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/Transaction.js:206:31)
    at ReactDefaultBatchingStrategyTransaction.perform (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/Transaction.js:153:22)
    at Object.batchedUpdates (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactDefaultBatchingStrategy.js:62:32)
    at Object.enqueueUpdate (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactUpdates.js:200:28)
    at enqueueUpdate (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactUpdateQueue.js:24:22)
    at Object.enqueueSetState (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react-dom/lib/ReactUpdateQueue.js:219:11)
    at FilePatchView.ReactComponent.setState (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/react/lib/ReactComponent.js:63:22)
    at FilePatchView.contextMenuOnItem (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/file-patch-view.js:255:18)
    at Object.contextMenuOnItem (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/hunk-view.js:100:65)
    at onWillShowContextMenu (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/views/hunk-view.js:152:58)
    at Function.handle (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/context-menu-interceptor.js:32:15)
    at HTMLDocument.contextMenuHandler (~/AppData/Local/atom/app-1.18.0-beta2/resources/app/node_modules/github/lib/context-menu-interceptor.js:68:32)

Commands

     -0:32.3.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always)
     -0:14.6.0 github:discard-selected-lines (div.github-HunkView-lineContent)

Non-Core Packages

atom-beautify 0.29.26 
atom-live-server 2.1.2 
atom-unsaved-changes 0.4.0 
autocomplete-paths 1.0.5 
block-comment 0.4.3 
build 0.68.0 
build-sass 0.11.0 
busy 0.7.0 
busy-signal 1.4.1 
color-picker 2.2.5 
console-log 1.10.0 
ctrl-dir-scroll 0.2.3 
cursor-blink-interval 0.3.1 
fake-image-snippets 1.1.0 
file-icons 2.1.6 
file-watcher 1.1.0 
filesize 3.0.0 
fonts 2.1.0 
goto-definition 1.3.3 
highlight-selected 0.13.1 
inc 0.0.4 
intentions 1.1.2 
jquery-snippets 11.0.0 
linter 2.1.4 
linter-eslint 8.2.1 
linter-htmlhint 1.3.3 
linter-jsonlint 1.3.0 
linter-less 2.6.0 
linter-scss-lint 3.1.0 
linter-ui-default 1.6.0 
minimap 4.28.2 
minimap-bookmarks 0.4.2 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
minimap-linter 2.0.0 
minimap-pigments 0.2.2 
minimap-selection 4.4.0 
minimap-split-diff 0.3.7 
my-package 0.0.0 
open-in-browser 0.5.2 
pigments 0.39.1 
project-manager 3.3.5 
random 1.3.0 
split-diff 1.4.0 
sync-settings 0.8.1 
tree-view-autoresize 2.0.0 
bug uncaught-exception

Most helpful comment

Here is an alternate set of repro steps:

  1. Modify more than one line in a file
  2. View the "Unstaged Changes" diff for the file using the "Git Tab"
  3. Select 2 or more modified lines
  4. Right click on the selected lines

Before the context menu even opens the exception occurs. Selecting a single line does not seem to have this problem.

All 18 comments

Thanks for the report! Can you confirm if the error is reproducible and if so, can you reproduce in safe mode (atom --safe)?

I just made a 1 line change, then right-clicked in the Git tab and selected "Discard Changes" but wasn't able to reproduce on 1.18.0-beta2 and Windows 10.

@rsese Hi, I can reproduce it in safe mode too.

  1. Make some differences in your file (remove a few lines)
  2. Open your file in Unstaged Changes mode
  3. Right mouse click on one of your deleted lines - Discard Selection
  4. Right mouse click on another deleted line - error appears

ahhh great, thanks for the detailed steps to reproduce - with these steps I can reproduce. I'll go ahead and update the steps to repro in the OP :v:

just FYI, I have reproduced this issue on macOS Sierra, also in Atom 1.18.0-beta2

I was able to reproduce in Atom 1.19.0-dev-0cd482cbf on OpenSUSE Tumbleweed.

I was not able to reproduce in Atom 1.19.0-beta0 on MacOS 10.12.

same err on windows 10

Same for me (Windows 7, Atom 1.18.0 x64) and closing tooltip with error is almost impossible: wherever you click you got it again and again untill you close the tab

Same on 1.18.0 x64 (Debian)

Here is an alternate set of repro steps:

  1. Modify more than one line in a file
  2. View the "Unstaged Changes" diff for the file using the "Git Tab"
  3. Select 2 or more modified lines
  4. Right click on the selected lines

Before the context menu even opens the exception occurs. Selecting a single line does not seem to have this problem.

I was seriously wondering if the "Discard Selection" button in the upper right corner just meant deselecting, as nothing was happening.

I got the exact same stacktrace, but with different steps.
edit: reproducable even in safe mode.

[Enter steps to reproduce:]

  1. make changes
  2. enter show hunk mode
  3. stage/unstage selections

Atom: 1.18.0 x64
Electron: 1.3.15
OS: Linux Mint
Thrown From: github package 0.3.3

Commands

     -2:26.3.0 core:move-right (input.hidden-input)
     -2:16 intentions:highlight (input.hidden-input)
     -2:15.4.0 core:select-all (input.hidden-input)
     -2:14.4.0 intentions:highlight (input.hidden-input)
     -2:13.2.0 core:save (input.hidden-input)
  2x -1:30.6.0 core:confirm (span.github-HunkView-plusMinus)

Non-Core Packages

atom-beautify 0.30.3 
atom-python-run 0.7.3 
busy-signal 1.4.3 
Hydrogen 1.18.0 
intentions 1.1.2 
linter 2.2.0 
linter-flake8 2.2.1 
linter-ui-default 1.6.2 
minimap 4.28.2 
save-session 0.15.7 

Encountered same bug on my Linux Arch guest, Windows 10 VirtualBox VM host setup
plx release fix :v
really need this for my workflow

Encountered same problem with same steps as above on MAC OS Sierra, using Atom 1.18.0

Same bug on Windows 7, Atom 1.18.0.

osx same splash error

I've got the same issue while discarding the selection

Atom: 1.18.0 x64
Electron: 1.3.15
OS: Mac OS X 10.12.5
Thrown From: github package 0.3.3

Stack Trace

Uncaught TypeError: Cannot read property 'isChanged' of undefined

At /Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/file-patch-selection.js:32

TypeError: Cannot read property 'isChanged' of undefined
    at Object.isItemSelectable (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/file-patch-selection.js:32:109)
    at ListSelection.isItemSelectable (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/list-selection.js:80:31)
    at ListSelection.getSelectedItems (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/list-selection.js:278:24)
    at FilePatchSelection.getSelectedLines (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/file-patch-selection.js:331:40)
    at FilePatchSelection.getSelectedHunks (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/file-patch-selection.js:259:40)
    at FilePatchView.render (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/file-patch-view.js:112:54)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:799:36)
    at ReactCompositeComponentWrapper._renderValidatedComponent (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:822:38)
    at ReactCompositeComponentWrapper._updateRenderedComponent (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:746:42)
    at ReactCompositeComponentWrapper._performComponentUpdate (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:724:16)
    at ReactCompositeComponentWrapper.updateComponent (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:645:18)
    at ReactCompositeComponentWrapper.performUpdateIfNecessary (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactCompositeComponent.js:561:18)
    at Object.performUpdateIfNecessary (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactReconciler.js:157:28)
    at runBatchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactUpdates.js:150:27)
    at ReactReconcileTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/Transaction.js:140:26)
    at ReactUpdatesFlushTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/Transaction.js:140:26)
    at ReactUpdatesFlushTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactUpdates.js:89:38)
    at Object.flushBatchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactUpdates.js:172:25)
    at ReactDefaultBatchingStrategyTransaction.closeAll (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/Transaction.js:206:31)
    at ReactDefaultBatchingStrategyTransaction.perform (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/Transaction.js:153:22)
    at Object.batchedUpdates (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactDefaultBatchingStrategy.js:62:32)
    at Object.enqueueUpdate (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactUpdates.js:200:28)
    at enqueueUpdate (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactUpdateQueue.js:24:22)
    at Object.enqueueSetState (/Applications/Atom.app/Contents/Resources/app/node_modules/react-dom/lib/ReactUpdateQueue.js:219:11)
    at FilePatchView.ReactComponent.setState (/Applications/Atom.app/Contents/Resources/app/node_modules/react/lib/ReactComponent.js:63:22)
    at FilePatchView.contextMenuOnItem (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/file-patch-view.js:276:18)
    at Object.contextMenuOnItem (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/hunk-view.js:115:65)
    at onWillShowContextMenu (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/views/hunk-view.js:178:58)
    at Function.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/context-menu-interceptor.js:32:15)
    at HTMLDocument.contextMenuHandler (/Applications/Atom.app/Contents/Resources/app/node_modules/github/lib/context-menu-interceptor.js:68:32)

Commands

     -2:01.3.0 snippets:previous-tab-stop (input.hidden-input)
     -2:01.3.0 editor:outdent-selected-rows (input.hidden-input)
  2x -1:56.2.0 autocomplete-plus:confirm (input.hidden-input)
     -1:50.7.0 core:copy (input.hidden-input)
     -1:48.2.0 editor:newline (input.hidden-input)
     -1:47.8.0 core:paste (input.hidden-input)
     -1:46 core:select-up (input.hidden-input)
     -1:45.2.0 snippets:previous-tab-stop (input.hidden-input)
     -1:45.2.0 editor:outdent-selected-rows (input.hidden-input)
  3x -1:40.2.0 core:delete (input.hidden-input)
     -1:38.6.0 core:save (input.hidden-input)
     -0:59.5.0 github:toggle-git-tab (input.hidden-input)
     -0:55.7.0 intentions:highlight (input.hidden-input)
     -0:54.9.0 github:toggle-github-tab (input.hidden-input)
     -0:49.4.0 github:toggle-git-tab (input.hidden-input)
  2x -0:31.5.0 github:discard-selected-lines (div.github-HunkView-lineNumber.is-new)

Non-Core Packages

atom-terminal 0.8.0 
atom-typescript 11.0.6 
autocomplete-elixir 1.5.14 
autocomplete-paths 1.0.5 
autocomplete-ruby 0.2.8 
build undefined 
build-rake 0.1.1 
busy 0.7.0 
busy-signal 1.4.3 
compare-files 0.8.0 
git-blame 1.1.1 
git-history 3.3.0 
git-log 0.4.1 
git-plus 7.9.3 
github-issues 0.9.0 
intentions 1.1.2 
language-docker 1.1.8 
language-elixir 0.19.0 
language-gherkin 1.0.4 
language-haml 0.25.0 
language-latex 1.0.0 
language-rust 0.4.11 
language-slim 0.5.0 
linter 2.2.0 
linter-coffeescript 1.0.0 
linter-erb 1.1.0 
linter-haml 2.0.1 
linter-htmlhint 1.3.3 
linter-rubocop 2.1.1 
linter-ruby 1.2.5 
linter-slim 1.0.0 
linter-ui-default 1.6.2 
ruby-block 0.3.6 
ruby-test 1.0.2 
RubyMotion 0.6.2 

Also found this issue on Arch - really annoying having to close and reopen the diff tab

Got the same issue on Atom 1.18.0 on macOS 10.12.5.

Was this page helpful?
0 / 5 - 0 ratings