Skip to content

Commit

Permalink
Merge pull request brianleroux#78 from mattg/master
Browse files Browse the repository at this point in the history
No adapter selected when options.adapter has a value
  • Loading branch information
brianleroux committed Dec 10, 2011
2 parents 35b2f6b + c3aeabf commit b7536ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Lawnchair.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ var Lawnchair = function (options, callback) {
var adapter
// if the adapter is passed in we try to load that only
if (options.adapter) {
adapter = Lawnchair.adapters[this.indexOf(Lawnchair.adapters, options.adapter)]
for (var i = 0; i < Lawnchair.adapters.length; i++) {
if (Lawnchair.adapters[i].adapter === options.adapter) {
adapter = Lawnchair.adapters[i];
break;
}
}
adapter = adapter.valid() ? adapter : undefined
// otherwise find the first valid adapter for this env
}
Expand Down

0 comments on commit b7536ee

Please sign in to comment.