From bc99786c91a4f9fcdddb48650e2ba078d76f5410 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Wed, 11 Jun 2014 15:05:38 -0700 Subject: [PATCH] Small clean ups --- packages/constraint-solver/constraints-list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/constraint-solver/constraints-list.js b/packages/constraint-solver/constraints-list.js index 41dbcd2d21..10eba34458 100644 --- a/packages/constraint-solver/constraints-list.js +++ b/packages/constraint-solver/constraints-list.js @@ -92,8 +92,8 @@ ConstraintSolver.ConstraintsList.prototype.forPackage = function (name, iter) { // doesn't break on the false return value ConstraintSolver.ConstraintsList.prototype.each = function (iter) { var self = this; - mori.each(self.byName, function (coll) { - mori.each(mori.last(coll), function (exactInexactColl) { + mori.each(self.byName, function (nameAndColl) { + mori.each(mori.last(nameAndColl), function (exactInexactColl) { mori.each(mori.last(exactInexactColl), function (c) { iter(mori.last(c)); }); @@ -213,7 +213,7 @@ ConstraintSolver.ConstraintsList.prototype.edgeMatchingVersionsFor = // there is some exact constraint, the choice is obvious if (exact) { var uv = exact.getSatisfyingUnitVersion(resolver); - if (_.isEmpty(self.violatedConstraints(uv))) + if (uv && _.isEmpty(self.violatedConstraints(uv))) return { earliest: uv, latest: uv }; else return { earliest: null, latest: null };