Skip to content

Commit

Permalink
[fix] Don't continue with the sorting if we don't have any attributes…
Browse files Browse the repository at this point in the history
…. Eg a `map#tag`
  • Loading branch information
3rd-Eden committed Aug 27, 2012
1 parent e6c1802 commit 57674a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/plates.js
Expand Up @@ -70,7 +70,11 @@ var Plates = (typeof module !== 'undefined' && typeof module.exports !== 'undefi
//
function compileMappings(oldMappings) {
var mappings = oldMappings.slice(0);

mappings.sort(function(map1, map2) {
if (!map1.attribute) return 1;
if (!map2.attribute) return -1;

if (map1.attribute !== map2.attribute) {
return map1.attribute < map2.attribute ? -1 : 1;
}
Expand Down

0 comments on commit 57674a5

Please sign in to comment.