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

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

Closed

Description

@lczech

[Enter steps to reproduce below:]

Cannot reproduce, but maybe the stack trace is still helpful. If not, this issue can also just be closed.

I did something like:

  1. Pasted some code.
  2. Used ctrl + ] for adjusting the indention.
  3. Pressed something like ctrl + z and x at the same time (by accident).

The current line was cut (so probably ctrl+x happend first), but using ctrl+z did not restore it, instead I received the error message.

Solved it by re-pasting the code and paying attention to not press too many buttons at the same time ;-)

Atom Version: 0.210.0
System: Ubuntu 14.04.2
Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot read property '0' of null

At /usr/share/atom/resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:881

TypeError: Cannot read property '0' of null
    at /usr/share/atom/resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:881:18
    at Array.forEach (native)
    at _.each._.forEach (/usr/share/atom/resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:79:11)
    at Object._.defaults (/usr/share/atom/resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:878:5)
    at History.module.exports.History.popUndoStack (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/history.js:94:11)
    at TextBuffer.module.exports.TextBuffer.undo (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:709:30)
    at TextEditor.module.exports.TextEditor.undo (/usr/share/atom/resources/app.asar/src/text-editor.js:1142:19)
    at TextEditor.atom.commands.add.stopEventPropagation.core:undo (/usr/share/atom/resources/app.asar/src/text-editor-element.js:320:19)
    at atom-text-editor.newCommandListeners.(anonymous function) (/usr/share/atom/resources/app.asar/src/text-editor-element.js:288:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:238:29)

Commands

     -0:57.2.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:56.4.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -0:55.9.0 core:paste (atom-text-editor.editor.is-focused)
     -0:55 core:save (atom-text-editor.editor.is-focused)
     -0:45.6.0 core:cut (atom-text-editor.editor.is-focused)
  2x -0:44.3.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:41.4.0 core:paste (atom-text-editor.editor.is-focused)
     -0:38.4.0 editor:outdent-selected-rows (atom-text-editor.editor.is-focused)
  2x -0:33.3.0 editor:indent-selected-rows (atom-text-editor.editor.is-focused)
     -0:28.6.0 docblockr:parse-enter (atom-text-editor.editor.is-focused)
     -0:28.6.0 editor:newline (atom-text-editor.editor.is-focused)
  2x -0:16.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:12.5.0 core:cut (atom-text-editor.editor.is-focused)
  7x -0:12.5.0 core:undo (atom-text-editor.editor.is-focused)
 31x -0:02.8.0 core:redo (atom-text-editor.editor.is-focused)
  2x -0:01.2.0 core:undo (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "symbols-view",
      "linter",
      "simple-drag-drop-text",
      "drag-drop-text",
      "language-c",
      "atom-beautify",
      "autocomplete-python",
      "Sublime-Style-Column-Selection",
      "word-jumper",
      "linter-clang"
    ],
    "themes": [
      "one-dark-ui",
      "lucas-dark-syntax"
    ],
    "destroyEmptyPanes": false
  },
  "editor": {
    "invisibles": {},
    "showIndentGuide": true,
    "showInvisibles": true,
    "preferredLineLength": 100,
    "softWrap": true,
    "tabLength": 4,
    "fontSize": 11
  }
}

Installed Packages

# User
atom-ctags, v4.1.2
autocomplete-clang, v0.7.0
block-travel, v1.0.2
docblockr, v0.7.2
hex, v0.6.2
highlight-line, v0.11.0
highlight-selected, v0.10.1
language-cmake, v0.1.4
language-cpp, v0.0.1
lucas-dark-syntax, v0.0.0
minimap, v4.10.0
minimap-bookmarks, v0.1.0
minimap-find-and-replace, v4.2.0
minimap-git-diff, v4.1.3
minimap-highlight-selected, v4.3.0
tabs-to-spaces, v0.11.0

# Dev
No dev packages

Activity

  1. izuzak commented on Jun 22, 2015

    @izuzak
    Contributor

    Thanks for the report, @lczech. ⚡

    👋 @maxbrunsfeld -- do you 👀 anything in that stack trace which might indicate what went down? Pinging you because this happened in popUndoStack but not sure if some package might caused this somehow.

  2. maxbrunsfeld commented on Jul 10, 2015

    @maxbrunsfeld
    Contributor

    I think this will be fixed in 1.0.3.

  3. andrewufrank commented on Mar 6, 2017

    @andrewufrank

    i pasted something and then asked for a buil-project (stack).

    the copy stacktrace to clipboard seems not to work. i wonder if this is related?
    i guess this is just a reminder that this error message can still occur in 1.14.3.

    the error message repeated (even after a close and reopen of atom). an issue could be that the focus was on the cabal file, not a .hs file. the next crash, when saving after a change in a .hs file is attached - perhaps it helps.
    the issue is perhaps, that i have a problem in the cabal file (noparse). no i fixed this and the error message does not appear anymore. (wish: cabal parser would give better error message!)

    Atom: 1.14.3 x64
    Electron: 1.3.13
    OS: Debian GNU/Linux
    Thrown From: haskell-ghc-mod package 1.19.7

    Stack Trace

    Haskell-ghc-mod: ghc-mod command check failed with error Error

    At caps: {"version":[5,7,0,0],"fileMap":true,"quoteArgs":true,"optparse":true,"typeConstraints":true,"browseParents":true,"interactiveCaseSplit":true,"importedFrom":false}
    URI: /home/frank/Workspace8/repo8/litMain/src/Main.hs
    Args: --
    message: Command failed: /home/frank/.local/bin/ghc-mod check /home/frank/Workspace8/repo8/litMain/src/Main.hs --
    cabal-helper-0.7.3.0-Cabal-1.24.2.0: /home/frank/Workspace8/repo8/litMain/litMain.cabal: 17: user error (Parse of field 'build-depends' failed.)
    ghc-mod: readCreateProcess: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/libexec/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0/cabal-helper-wrapper "--with-ghc=/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin/ghc" "--with-ghc-pkg=/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin/ghc-pkg" "--with-cabal=cabal" "/home/frank/Workspace8/repo8/litMain" "/home/frank/Workspace8/repo8/litMain/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0" "package-db-stack" "entrypoints" "source-dirs" "ghc-options" "ghc-src-options" "ghc-pkg-options" "ghc-merged-pkg-options" "ghc-lang-options" "licenses" "flags" "config-flags" "non-default-config-flags" "compiler-version" (exit 1): failed
    
    log:
    -0.301s: "Main did-save triggered"
    -0.301s: "Main updating"
    -0.299s: "Running /home/frank/.local/bin/ghc-mod check,/home/frank/Workspace8/repo8/litMain/src/Main.hs,-- with opts = ",{"cwd":"/home/frank/Workspace8/repo8/litMain","env":{"ATOM_HOME":"/home/frank/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LS_COLORS":"","XDG_MENU_PREFIX":"xfce-","LANG":"en_US.utf8","DISPLAY":":0.0","XDG_VTNR":"7","SSH_AUTH_SOCK":"/tmp/ssh-Ba3luyiOtyIi/agent.1676","CLASSPATH":"pikes-tintop-1.0-SNAPSHOT-jar-with-dependencies.jar:Semafor-3.0-alpha-04.jar:models/stanford-corenlp-3.5.2-models.jar","GLADE_CATALOG_PATH":":","XDG_SESSION_ID":"2","XDG_GREETER_DATA_DIR":"/var/lib/lightdm/data/frank","USER":"frank","GLADE_MODULE_PATH":":","DESKTOP_SESSION":"lightdm-xsession","PWD":"/home/frank","HOME":"/home/frank","SSH_AGENT_PID":"1717","QT_ACCESSIBILITY":"1","XDG_SESSION_TYPE":"x11","XDG_DATA_DIRS":"/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share","XDG_SESSION_DESKTOP":"lightdm-xsession","GLADE_PIXMAP_PATH":":","DESKTOP_STARTUP_ID":"wrapper-1.0/|usr|share|atom|atom/1781-2-santafe_TIME25754329","GTK_MODULES":"gail:atk-bridge","SHELL":"/bin/bash","XDG_SEAT_PATH":"/org/freedesktop/DisplayManager/Seat0","XDG_CURRENT_DESKTOP":"XFCE","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","SHLVL":"1","XDG_SEAT":"seat0","LANGUAGE":"en_US:en","GDMSESSION":"lightdm-xsession","LOGNAME":"frank","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1010/bus","XDG_RUNTIME_DIR":"/run/user/1010","XAUTHORITY":"/home/frank/.Xauthority","XDG_SESSION_PATH":"/org/freedesktop/DisplayManager/Session0","XDG_CONFIG_DIRS":"/etc/xdg","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/home/frank/Workspace8/repo8/litMain/.stack-work/install/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin:/home/frank/.local/bin:/home/frank/.local/bin/:/home/frank/ghc-mod-sandbox/bin/:/home/frank/.cabal/bin:/home/frank/Debinstall83/deb9/amd9.bin:/home/frank/.bin:/home/frank/.bin/corenlp:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games","SESSION_MANAGER":"local/santafe:@/tmp/.ICE-unix/1727,unix/santafe:/tmp/.ICE-unix/1727","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
    -0.287s: "Running /home/frank/.local/bin/ghc-mod check,/home/frank/Workspace8/repo8/litMain/src/Main.hs,-- with opts = ",{"cwd":"/home/frank/Workspace8/repo8/litMain","env":{"ATOM_HOME":"/home/frank/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LS_COLORS":"","XDG_MENU_PREFIX":"xfce-","LANG":"en_US.utf8","DISPLAY":":0.0","XDG_VTNR":"7","SSH_AUTH_SOCK":"/tmp/ssh-Ba3luyiOtyIi/agent.1676","CLASSPATH":"pikes-tintop-1.0-SNAPSHOT-jar-with-dependencies.jar:Semafor-3.0-alpha-04.jar:models/stanford-corenlp-3.5.2-models.jar","GLADE_CATALOG_PATH":":","XDG_SESSION_ID":"2","XDG_GREETER_DATA_DIR":"/var/lib/lightdm/data/frank","USER":"frank","GLADE_MODULE_PATH":":","DESKTOP_SESSION":"lightdm-xsession","PWD":"/home/frank","HOME":"/home/frank","SSH_AGENT_PID":"1717","QT_ACCESSIBILITY":"1","XDG_SESSION_TYPE":"x11","XDG_DATA_DIRS":"/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share","XDG_SESSION_DESKTOP":"lightdm-xsession","GLADE_PIXMAP_PATH":":","DESKTOP_STARTUP_ID":"wrapper-1.0/|usr|share|atom|atom/1781-2-santafe_TIME25754329","GTK_MODULES":"gail:atk-bridge","SHELL":"/bin/bash","XDG_SEAT_PATH":"/org/freedesktop/DisplayManager/Seat0","XDG_CURRENT_DESKTOP":"XFCE","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","SHLVL":"1","XDG_SEAT":"seat0","LANGUAGE":"en_US:en","GDMSESSION":"lightdm-xsession","LOGNAME":"frank","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1010/bus","XDG_RUNTIME_DIR":"/run/user/1010","XAUTHORITY":"/home/frank/.Xauthority","XDG_SESSION_PATH":"/org/freedesktop/DisplayManager/Session0","XDG_CONFIG_DIRS":"/etc/xdg","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/home/frank/Workspace8/repo8/litMain/.stack-work/install/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin:/home/frank/.local/bin:/home/frank/.local/bin/:/home/frank/ghc-mod-sandbox/bin/:/home/frank/.cabal/bin:/home/frank/Debinstall83/deb9/amd9.bin:/home/frank/.bin:/home/frank/.bin/corenlp:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games","SESSION_MANAGER":"local/santafe:@/tmp/.ICE-unix/1727,unix/santafe:/tmp/.ICE-unix/1727","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
    -0.273s: "Running /home/frank/.local/bin/ghc-mod browse,-d,-p,--,Main with opts = ",{"cwd":"/home/frank/Workspace8/repo8/litMain","env":{"ATOM_HOME":"/home/frank/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LS_COLORS":"","XDG_MENU_PREFIX":"xfce-","LANG":"en_US.utf8","DISPLAY":":0.0","XDG_VTNR":"7","SSH_AUTH_SOCK":"/tmp/ssh-Ba3luyiOtyIi/agent.1676","CLASSPATH":"pikes-tintop-1.0-SNAPSHOT-jar-with-dependencies.jar:Semafor-3.0-alpha-04.jar:models/stanford-corenlp-3.5.2-models.jar","GLADE_CATALOG_PATH":":","XDG_SESSION_ID":"2","XDG_GREETER_DATA_DIR":"/var/lib/lightdm/data/frank","USER":"frank","GLADE_MODULE_PATH":":","DESKTOP_SESSION":"lightdm-xsession","PWD":"/home/frank","HOME":"/home/frank","SSH_AGENT_PID":"1717","QT_ACCESSIBILITY":"1","XDG_SESSION_TYPE":"x11","XDG_DATA_DIRS":"/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share","XDG_SESSION_DESKTOP":"lightdm-xsession","GLADE_PIXMAP_PATH":":","DESKTOP_STARTUP_ID":"wrapper-1.0/|usr|share|atom|atom/1781-2-santafe_TIME25754329","GTK_MODULES":"gail:atk-bridge","SHELL":"/bin/bash","XDG_SEAT_PATH":"/org/freedesktop/DisplayManager/Seat0","XDG_CURRENT_DESKTOP":"XFCE","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","SHLVL":"1","XDG_SEAT":"seat0","LANGUAGE":"en_US:en","GDMSESSION":"lightdm-xsession","LOGNAME":"frank","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1010/bus","XDG_RUNTIME_DIR":"/run/user/1010","XAUTHORITY":"/home/frank/.Xauthority","XDG_SESSION_PATH":"/org/freedesktop/DisplayManager/Session0","XDG_CONFIG_DIRS":"/etc/xdg","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/home/frank/Workspace8/repo8/litMain/.stack-work/install/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.2/8.0.2/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin:/home/frank/.local/bin:/home/frank/.local/bin/:/home/frank/ghc-mod-sandbox/bin/:/home/frank/.cabal/bin:/home/frank/Debinstall83/deb9/amd9.bin:/home/frank/.bin:/home/frank/.bin/corenlp:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games","SESSION_MANAGER":"local/santafe:@/tmp/.ICE-unix/1727,unix/santafe:/tmp/.ICE-unix/1727","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
    -0.026s: "cabal-helper-0.7.3.0-Cabal-1.24.2.0: /home/frank/Workspace8/repo8/litMain/litMain.cabal: 17: user error (Parse of field 'build-depends' failed.)\nghc-mod: readCreateProcess: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/libexec/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0/cabal-helper-wrapper \"--with-ghc=/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin/ghc\" \"--with-ghc-pkg=/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin/ghc-pkg\" \"--with-cabal=cabal\" \"/home/frank/Workspace8/repo8/litMain\" \"/home/frank/Workspace8/repo8/litMain/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0\" \"package-db-stack\" \"entrypoints\" \"source-dirs\" \"ghc-options\" \"ghc-src-options\" \"ghc-pkg-options\" \"ghc-merged-pkg-options\" \"ghc-lang-options\" \"licenses\" \"flags\" \"config-flags\" \"non-default-config-flags\" \"compiler-version\" (exit 1): failed\n"
    -0.026s: "Running /home/frank/.local/bin/ghc-mod check,/home/frank/Workspace8/repo8/litMain/src/Main.hs,-- failed with ",{"killed":false,"code":1,"signal":null,"cmd":"/home/frank/.local/bin/ghc-mod check /home/frank/Workspace8/repo8/litMain/src/Main.hs --"}
    -0.001s: {"killed":false,"code":1,"signal":null,"cmd":"/home/frank/.local/bin/ghc-mod check /home/frank/Workspace8/repo8/litMain/src/Main.hs --"}
    
    Error
        at /packages/haskell-ghc-mod/lib/util.coffee:60:26
        at ChildProcess.exithandler (child_process.js:225:5)
        at emitTwo (events.js:106:13)
        at ChildProcess.emit (events.js:191:7)
        at maybeClose (internal/child_process.js:877:16)
        at Socket.<anonymous> (internal/child_process.js:334:11)
        at emitOne (events.js:96:13)
        at Socket.emit (events.js:188:7)
        at Pipe._handle.close [as _onclose] (net.js:493:12)
    

    Commands

      2x -0:58.9.0 ide-haskell-cabal:build (input.hidden-input)
         -0:31.2.0 core:save (input.hidden-input)
      2x -0:31.1.0 ide-haskell:prettify-file (atom-text-editor.editor.is-focused)
    

    Non-Core Packages

    autocomplete-haskell 0.7.2 
    busy 0.7.0 
    git-plus 7.3.3 
    haskell-ghc-mod 1.19.7 
    ide-haskell 1.9.5 
    ide-haskell-cabal 1.8.1 
    language-haskell 1.12.1 
    
  4. lock commented on May 5, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  5. locked as resolved and limited conversation to collaborators on May 5, 2018
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