Permalink
Browse files

Fixed bug where no adapter is selected when options.adapter is defined.

  • Loading branch information...
1 parent 35b2f6b commit c3aeabfaabf32dd1e70dca1ac4574ff2abf14d58 Matt Gifford committed Dec 9, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/Lawnchair.js
View
7 src/Lawnchair.js
@@ -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
}

0 comments on commit c3aeabf

Please sign in to comment.