pusher / atom-pair

An Atom package that allows for epic pair programming
MIT License
1.45k stars 28 forks source link

Uncaught TypeError: Cannot read property 'getGrammar' of null #52

Closed addy closed 7 years ago

addy commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.2 System: Mac OS X 10.10.3 Thrown From: atom-pair package, v1.1.6

Stack Trace

Uncaught TypeError: Cannot read property 'getGrammar' of null

At /Users/addisons/.atom/packages/atom-pair/lib/modules/grammar_sync.coffee:6

TypeError: Cannot read property 'getGrammar' of null
  at Object.module.exports.GrammarSync.sendGrammar (/Users/addisons/.atom/packages/atom-pair/lib/modules/grammar_sync.coffee:6:22)
  at /Users/addisons/.atom/packages/atom-pair/lib/atom_pair.coffee:174:8
  at PresenceChannel.prototype.emit (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:855:17)
  at PresenceChannel.prototype.handleEvent (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:3822:8)
  at /Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:74:9
  at ConnectionManager.prototype.emit (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:855:17)
  at message (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:3420:6)
  at Connection.prototype.emit (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:855:17)
  at listeners.message (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:3048:8)
  at TransportConnection.prototype.emit (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:855:17)
  at TransportConnection.prototype.onMessage (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:2210:6)
  at WebSocket.self.socket.onmessage (/Users/addisons/.atom/packages/atom-pair/lib/pusher/pusher.js:2232:6)

Commands

     -4:52.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -4:16.8.0 command-palette:toggle (div.settings-view.pane-item)
     -4:12.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -4:12.4.0 AtomPair:start new pairing session (div.settings-view.pane-item)
     -4:04.1.0 AtomPair:copyid (div.session-id)
     -2:59.4.0 editor:newline (atom-text-editor#AtomPair.editor.is-focused)
     -2:33.4.0 command-palette:toggle (atom-text-editor#AtomPair.editor.is-focused)
  4x -2:30.1.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -2:27.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -2:27.3.0 AtomPair:start new pairing session (atom-text-editor#AtomPair.editor)
     -2:24 AtomPair:copyid (div.session-id)
     -1:12 application:new-file (ul.list-inline.tab-bar.inset-panel)

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "midnight-picnic"
    ]
  }
}

Installed Packages

# User
atom-pair, v1.1.6
midnight-picnic, v1.0.0

# Dev
No dev packages
jpatel531 commented 9 years ago

Ah gee - it looks like there isn't an active editor. Were you on a non-editor page, e.g. the config/packages page when this occurred? I think the package tries to ensure an active editor, but I might have missed a case

addy commented 9 years ago

There's a high chance I was in a non-editor page but I remember being just in an untitled editor when I was testing with a friend. The text would duplicate from his to my editor like 5x. so 'Hello' would become 'HHHHHeeeeelllllooooo'

I'll try to recreate it again later if you want more info. Probably a freak edge case.