Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

TypeError: Cannot read property 'getPath' of undefined #22542

Closed
1 task done
ToxicPie opened this issue Jun 4, 2021 · 2 comments · Fixed by #22543
Closed
1 task done

TypeError: Cannot read property 'getPath' of undefined #22542

ToxicPie opened this issue Jun 4, 2021 · 2 comments · Fixed by #22543

Comments

@ToxicPie
Copy link
Contributor

ToxicPie commented Jun 4, 2021

Prerequisites

Description

When renaming an opened file in a git repository with the tree view, it shows the line Cannot read property 'getPath' of undefined under the dialog (but the file is renamed). The exception is thrown inside the git-diff package and its stack trace is:

Stack trace

TypeError: Cannot read property 'getPath' of undefined
    at /usr/lib/atom/node_modules/git-diff/lib/git-diff-view.js:131:45
    at Function.simpleDispatch (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:64:14)
    at Emitter.emit (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:257:28)
    at /usr/lib/atom/src/text-editor.js:820:22
    at Function.simpleDispatch (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:64:14)
    at Emitter.emit (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:257:28)
    at TextBuffer.setFile (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:587:18)
    at TextBuffer.setPath (/usr/lib/atom/node_modules/text-buffer/lib/text-buffer.js:554:17)
    at /usr/lib/atom/node_modules/tree-view/lib/tree-view.js:149:34
    at Function.simpleDispatch (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:64:14)
    at Emitter.emit (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:257:28)
    at MoveDialog.onMove (/usr/lib/atom/node_modules/tree-view/lib/tree-view.js:1055:36)
    at MoveDialog.module.exports.MoveDialog.onConfirm (/usr/lib/atom/node_modules/tree-view/lib/move-dialog.js:65:16)
    at HTMLDivElement.Dialog.atom.commands.add.core:confirm (/usr/lib/atom/node_modules/tree-view/lib/dialog.js:53:26)
    at CommandRegistry.handleCommandEvent (/usr/lib/atom/src/command-registry.js:405:43)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/lib/atom/node_modules/atom-keymap/lib/keymap-manager.js:617:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/lib/atom/node_modules/atom-keymap/lib/keymap-manager.js:408:22)
    at WindowEventHandler.handleDocumentKeyEvent (/usr/lib/atom/src/window-event-handler.js:153:34)

Steps to Reproduce

  1. Add any git repository to the project.
  2. Open a file inside the repository.
  3. Rename the opened file by right-clicking it in the tree view -> rename.

Versions

OS: Arch Linux
Atom:

Atom    : 1.57.0
Electron: 9.4.4
Chrome  : 83.0.4103.122
Node    : 12.14.1
@ThatXliner
Copy link
Contributor

I can reproduce

Atom    : 1.57.0
Electron: 9.4.4
Chrome  : 83.0.4103.122
Node    : 12.14.1
apm  2.6.2
npm  6.14.13
node 12.14.1 x64
atom 1.57.0
python 3.7.9
git 2.30.1

MacOS 11.2.1 (Intel chip)

@icecream17
Copy link
Contributor

Also reproduced

Atom    : 1.58.0-beta0
Electron: 9.4.4
Chrome  : 83.0.4103.122
Node    : 12.14.1
apm  2.6.2
npm  6.14.13
node 12.14.1 x64
atom 1.58.0-beta0
python 3.9.5
git 2.31.1.windows.1
visual studio 2015

Oops, after reproducing I realized I've already approved the pr.

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

Successfully merging a pull request may close this issue.

3 participants