mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Better error handling on passing invalid packs
This commit is contained in:
@@ -755,6 +755,10 @@ module.exports = class PackageManager {
|
||||
// Deactivate the package with the given name
|
||||
async deactivatePackage (name, suppressSerialization) {
|
||||
const pack = this.getLoadedPackage(name)
|
||||
if (pack == null) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!suppressSerialization && this.isPackageActive(pack.name)) {
|
||||
this.serializePackage(pack)
|
||||
}
|
||||
|
||||
@@ -285,7 +285,8 @@ class ThemeManager
|
||||
deactivateThemes: ->
|
||||
@removeActiveThemeClasses()
|
||||
@unwatchUserStylesheet()
|
||||
Promise.all(@packageManager.deactivatePackage(pack.name) for pack in @getActiveThemes())
|
||||
results = @getActiveThemes().map((pack) => @packageManager.deactivatePackage(pack.name))
|
||||
Promise.all(results.filter((r) => typeof r?.then is 'function'))
|
||||
|
||||
isInitialLoadComplete: -> @initialLoadComplete
|
||||
|
||||
|
||||
Reference in New Issue
Block a user