{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/9081","labels_url":"https://api.github.com/repos/atom/atom/issues/9081/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/9081/comments","events_url":"https://api.github.com/repos/atom/atom/issues/9081/events","html_url":"https://github.com/atom/atom/issues/9081","id":110395088,"number":9081,"title":"Uncaught TypeError when fold section button clicked in .coffee file","user":{"login":"giyyapan","id":3479453,"avatar_url":"https://avatars.githubusercontent.com/u/3479453?v=3","gravatar_id":"","url":"https://api.github.com/users/giyyapan","html_url":"https://github.com/giyyapan","followers_url":"https://api.github.com/users/giyyapan/followers","following_url":"https://api.github.com/users/giyyapan/following{/other_user}","gists_url":"https://api.github.com/users/giyyapan/gists{/gist_id}","starred_url":"https://api.github.com/users/giyyapan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giyyapan/subscriptions","organizations_url":"https://api.github.com/users/giyyapan/orgs","repos_url":"https://api.github.com/users/giyyapan/repos","events_url":"https://api.github.com/users/giyyapan/events{/privacy}","received_events_url":"https://api.github.com/users/giyyapan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-08T08:17:20Z","updated_at":"2015-10-08T08:23:48Z","closed_at":null,"body":"I've seen a [issue](https://github.com/smashwilson/merge-conflicts/issues/98) which has similar stack trace, but this one can be different.\r\n\r\n### Step to reproduce:\r\n\r\n1. open a .coffee file\r\n2. click one of the fold button (on the left of edit panel, right to line number, only visible when mouse hover). This may cause the bug.\r\n3. if bug didn't appear, try another fold button.\r\n\r\nThe bug dosn't appear every time, event when I click the same button. \r\nIf you click one fold button for many times repidly, the bug appears to.\r\n\r\n**Atom Version**: 1.0.19\r\n**System**: Ubuntu 14.04.3\r\n**Thrown From**: Atom Core\r\n\r\n\r\n### Stack Trace\r\n\r\nUncaught TypeError: Cannot read property 'onDidDestroy' of undefined\r\n\r\n```\r\nAt /usr/share/atom/resources/app.asar/src/decoration.js:62\r\n\r\nTypeError: Cannot read property 'onDidDestroy' of undefined\r\n  at new Decoration (/usr/share/atom/resources/app.asar/src/decoration.js:62:49)\r\n  at DisplayBuffer.module.exports.DisplayBuffer.decorateMarker (/usr/share/atom/resources/app.asar/src/display-buffer.js:1319:20)\r\n  at DisplayBuffer.module.exports.DisplayBuffer.decorateFold (/usr/share/atom/resources/app.asar/src/display-buffer.js:1720:19)\r\n  at DisplayBuffer.module.exports.DisplayBuffer.handleBufferMarkerCreated (/usr/share/atom/resources/app.asar/src/display-buffer.js:1709:14)\r\n  at /usr/share/atom/resources/app.asar/src/display-buffer.js:5:61\r\n  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)\r\n  at TextBuffer.module.exports.TextBuffer.markerCreated (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1354:20)\r\n  at MarkerStore.module.exports.MarkerStore.createMarker (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/marker-store.js:332:21)\r\n  at MarkerStore.module.exports.MarkerStore.markRange (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/marker-store.js:149:19)\r\n  at TextBuffer.module.exports.TextBuffer.markRange (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:695:31)\r\n  at DisplayBuffer.module.exports.DisplayBuffer.createFold (/usr/share/atom/resources/app.asar/src/display-buffer.js:843:95)\r\n  at TextEditor.module.exports.TextEditor.createFold (/usr/share/atom/resources/app.asar/src/text-editor.js:2571:33)\r\n  at LanguageMode.module.exports.LanguageMode.foldBufferRow (/usr/share/atom/resources/app.asar/src/language-mode.js:148:30)\r\n  at TextEditor.module.exports.TextEditor.foldBufferRow (/usr/share/atom/resources/app.asar/src/text-editor.js:2511:32)\r\n  at LineNumberGutterComponent.module.exports.LineNumberGutterComponent.onClick (/usr/share/atom/resources/app.asar/src/line-number-gutter-component.js:137:30)\r\n  at HTMLDivElement.<anonymous> (/usr/share/atom/resources/app.asar/src/line-number-gutter-component.js:3:61)\r\n\r\n```\r\n\r\n### Commands\r\n\r\n```\r\n     -1:28.8.0 editor:move-to-beginning-of-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:28.7.0 atomic-emacs:next-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n  2x -1:28.5.0 atomic-emacs:previous-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:28.2.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n  2x -1:28.2.0 atomic-emacs:previous-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:27.8.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:27.7.0 atomic-emacs:backward-char (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:27.4.0 atomic-emacs:next-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:27.2.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n  2x -1:27.1.0 atomic-emacs:backward-char (atom-text-editor.editor.emacs-plus.is-focused)\r\n  4x -1:25.7.0 editor:select-word (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:24.6.0 editor:consolidate-selections (atom-text-editor.editor.emacs-plus.is-focused.mark-mode)\r\n     -1:24.6.0 core:cancel (atom-text-editor.editor.emacs-plus.is-focused.mark-mode)\r\n     -1:24.4.0 editor:move-to-beginning-of-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n  3x -1:24.4.0 atomic-emacs:next-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n     -1:23.3.0 atomic-emacs:previous-line (atom-text-editor.editor.emacs-plus.is-focused)\r\n```\r\n\r\n### Config\r\n\r\n```json\r\n{\r\n  \"core\": {\r\n    \"packagesWithKeymapsDisabled\": [\r\n      \"remote-edit\"\r\n    ],\r\n    \"autoHideMenuBar\": true,\r\n    \"disabledPackages\": [\r\n      \"Remote-FTP\"\r\n    ]\r\n  },\r\n  \"editor\": {\r\n    \"invisibles\": {},\r\n    \"backUpBeforeSaving\": true\r\n  }\r\n}\r\n```\r\n\r\n### Installed Packages\r\n\r\n```coffee\r\n# User\r\natomic-emacs, v0.7.4\r\ncoffee-compile, v0.19.0\r\nemacs-plus, v0.9.8\r\nless-autocompile, v1.0.0\r\nminimap, v4.13.4\r\nminimap-find-and-replace, v4.3.0\r\nminimap-git-diff, v4.1.8\r\nminimap-hide, v0.3.0\r\nminimap-linter, v1.0.0\r\nremote-edit, v1.8.21\r\nsymbol-gen, v1.0.0\r\nsync-settings, v0.6.0\r\n\r\n# Dev\r\nNo dev packages\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/146454016","html_url":"https://github.com/atom/atom/issues/9081#issuecomment-146454016","issue_url":"https://api.github.com/repos/atom/atom/issues/9081","id":146454016,"user":{"login":"izuzak","id":38924,"avatar_url":"https://avatars.githubusercontent.com/u/38924?v=3","gravatar_id":"","url":"https://api.github.com/users/izuzak","html_url":"https://github.com/izuzak","followers_url":"https://api.github.com/users/izuzak/followers","following_url":"https://api.github.com/users/izuzak/following{/other_user}","gists_url":"https://api.github.com/users/izuzak/gists{/gist_id}","starred_url":"https://api.github.com/users/izuzak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/izuzak/subscriptions","organizations_url":"https://api.github.com/users/izuzak/orgs","repos_url":"https://api.github.com/users/izuzak/repos","events_url":"https://api.github.com/users/izuzak/events{/privacy}","received_events_url":"https://api.github.com/users/izuzak/received_events","type":"User","site_admin":true},"created_at":"2015-10-08T08:23:48Z","updated_at":"2015-10-08T08:23:48Z","body":"Thanks for the report, @giyyapan, but I'm having trouble reproducing this. Have you been able to reproduce this in [safe mode](https://atom.io/docs/latest/hacking-atom-debugging#check-if-the-problem-shows-up-in-safe-mode)?\r\n\r\nStill, seems like something Atom should be handling better. /cc @nathansobo @maxbrunsfeld "}}