read only handling correction
authorjulesstp <julianmcarlin@gmail.com>
Wed, 30 Apr 2014 17:10:13 +0000 (11:10 -0600)
committerjulesstp <julianmcarlin@gmail.com>
Wed, 30 Apr 2014 17:10:13 +0000 (11:10 -0600)
enyo-client/application/source/models/currency.js

index bdf7a7f..7e7c490 100644 (file)
     statusReadyClean: function () {
       // If there is no Base currency set, make it not readOnly
       var coll = this.collection,
+        hasBase;
+
+      if (coll && coll.models) {
         hasBase = _.find(coll.models, function (model) {
           return model.get("isBase") === true;
         });
+      } 
 
       if (!hasBase) {
         this.setReadOnly("isBase", false);