abe33 / minimap-pigments

An Atom plugin to display pigments colors in the Minimap
MIT License
15 stars 6 forks source link

Error deactivating package 'minimap-pigments' TypeError: Cannot read property 'dispose' of undefined #6

Open viddo opened 8 years ago

viddo commented 8 years ago

Noticed this while developing another plugin, triggered when reloading the window:

/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:655 Error deactivating package 'minimap-pigments' TypeError: Cannot read property 'dispose' of undefined
    at Object.module.exports.deactivate (/Users/viddo/.atom/packages/minimap-pigments/lib/minimap-pigments.coffee:24:25)
    at Package.module.exports.Package.deactivate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:644:21)
    at PackageManager.module.exports.PackageManager.deactivatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:622:12)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:608:19
    at Config.module.exports.Config.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:312:16)
    at PackageManager.module.exports.PackageManager.deactivatePackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:602:19)
    at AtomEnvironment.module.exports.AtomEnvironment.unloadEditorWindow (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:799:21)
    at WindowEventHandler.module.exports.WindowEventHandler.handleWindowBeforeunload (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:196:30)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61module.exports.Package.deactivate @ /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:655module.exports.PackageManager.deactivatePackage @ /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:622(anonymous function) @ /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:608module.exports.Config.transact @ /Applications/Atom.app/Contents/Resources/app.asar/src/config.js:312module.exports.PackageManager.deactivatePackages @ /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:602module.exports.AtomEnvironment.unloadEditorWindow @ /Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:799module.exports.WindowEventHandler.handleWindowBeforeunload @ /Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:196(anonymous function) @ /Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3

https://github.com/abe33/minimap-pigments/blob/master/lib/minimap-pigments.coffee#L24 @editorsSubscription does not always exist, it seems

abe33 commented 8 years ago

Hi @viddo, thanks for the report. I'll take a look to to see how to fix this.