Fix previous commit
authorDarren <darren@darrenwhitlen.com>
Sun, 26 Aug 2012 20:58:51 +0000 (21:58 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 26 Aug 2012 20:58:51 +0000 (21:58 +0100)
client_backbone/model.js

index 9432844761ec2ef1caf8cf72fae2223e5836a496..ea1fdcca5821bfe71c99407e380fd66b90d78d5c 100644 (file)
@@ -55,8 +55,8 @@ kiwi.model.MemberList = Backbone.Collection.extend({
         this.view = new kiwi.view.MemberList({"model": this});\r
     },\r
     getByNick: function (nick) {\r
+        if (typeof nick !== 'string') return;\r
         return this.find(function (m) {\r
-            if (typeof m !== 'string') return;\r
             return nick.toLowerCase() === m.get('nick').toLowerCase();\r
         });\r
     }\r
@@ -178,8 +178,8 @@ kiwi.model.PanelList = Backbone.Collection.extend({
 \r
     },\r
     getByName: function (name) {\r
+        if (typeof name !== 'string') return;\r
         return this.find(function (c) {\r
-            if (typeof c !== 'string') return;\r
             return name.toLowerCase() === c.get('name').toLowerCase();\r
         });\r
     }\r