Skip to content
This repository
Browse code

[fix] Don't continue with the sorting if we don't have any attributes…

…. Eg a `map#tag`
  • Loading branch information...
commit 57674a58597d3b5835e37e4af7ebd3dd787c3ad6 1 parent e6c1802
Arnout Kazemier authored August 27, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  lib/plates.js
4  lib/plates.js
@@ -70,7 +70,11 @@ var Plates = (typeof module !== 'undefined' && typeof module.exports !== 'undefi
70 70
   //
71 71
   function compileMappings(oldMappings) {
72 72
     var mappings = oldMappings.slice(0);
  73
+
73 74
     mappings.sort(function(map1, map2) {
  75
+      if (!map1.attribute) return 1;
  76
+      if (!map2.attribute) return -1;
  77
+
74 78
       if (map1.attribute !== map2.attribute) {
75 79
         return map1.attribute < map2.attribute ? -1 : 1;
76 80
       }

0 notes on commit 57674a5

Please sign in to comment.
Something went wrong with that request. Please try again.