Permalink
Browse files

Error handling for the case when a launcher is not found by name, and…

… print a warning to the debug log #61.
  • Loading branch information...
airportyh committed Nov 26, 2012
1 parent e739da3 commit 3df8d72395b41d3d2cfb8f4f78f253518b403dc5
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/config.js
View
@@ -151,9 +151,16 @@ Config.prototype.getWantedLauncherNames = function(available){
}
Config.prototype.getWantedLaunchers = function(available){
- return this.getWantedLauncherNames(available).map(function(name){
- return available[name.toLowerCase()]
+ var launchers = []
+ this.getWantedLauncherNames(available).forEach(function(name){
+ var launcher = available[name.toLowerCase()]
+ if (!launcher){
+ log.warn('Launcher "' + name + '" is not recognized.')
+ }else{
+ launchers.push(launcher)
+ }
})
+ return launchers
}
Config.prototype.printLauncherInfo = function(){

0 comments on commit 3df8d72

Please sign in to comment.