Skip to content

Commit

Permalink
fix models length issue
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Sep 30, 2024
1 parent be399c8 commit 5cf4714
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Alloy/commands/compile/compilerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ exports.generateCollectionBindingTemplate = function(args) {
code += ' if (e && e.fromAdapter) { return; }';
code += ' var opts = ' + handlerFunc + '.opts || {};';
code += ' var models = ' + whereCode + ';';
code += ' var len = models.length;';
code += ' var len = models ? models.length : 0;';
code += '<%= pre %>';
code += ' for (var i = 0; i < len; i++) {';
code += ' var <%= localModel %> = models[i];';
Expand Down

0 comments on commit 5cf4714

Please sign in to comment.