       @packageManager.emit('package-installing', @pack)
 
       @packageManager.install @pack, (error) =>
-        if error
+        if error?
           console.error("Installing #{@type} #{@pack.name} failed", error.stack ? error, error.stderr)
 
     @learnMoreButton.on 'click', =>


  handlePackageEvents: ->
    @subscribe @packageManager, 'package-installed package-install-failed theme-installed theme-install-failed', (pack, error) =>
      if pack.name == @pack.name
        if error
          @setStatusIcon('alert')
          @installButton.prop('disabled', false)
        else

          @installButton.text('Installed')

    @subscribe @packageManager, 'package-installing', (pack) =>
      if pack.name is @pack.name
        @installButton.prop('disabled', true)
        @setStatusIcon('cloud-download')

