Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit c3aeabfaabf32dd1e70dca1ac4574ff2abf14d58 1 parent 35b2f6b
Matt Gifford authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/Lawnchair.js
7 src/Lawnchair.js
View
@@ -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
}
Please sign in to comment.
Something went wrong with that request. Please try again.