Skip to content

Commit 6d2f655

Browse files
committed
Add check for failed binding comparison
1 parent fb0ff70 commit 6d2f655

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plots/command.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,12 @@ exports.manageCommandObserver = function(gd, container, commandList, onchange) {
145145
* 3. the same property must be affected by all commands
146146
*/
147147
exports.hasSimpleAPICommandBindings = function(gd, commandList, bindingsByValue) {
148+
var i;
148149
var n = commandList.length;
149150

150151
var refBinding;
151152

152-
for(var i = 0; i < n; i++) {
153+
for(i = 0; i < n; i++) {
153154
var binding;
154155
var command = commandList[i];
155156
var method = command.method;
@@ -207,6 +208,8 @@ exports.hasSimpleAPICommandBindings = function(gd, commandList, bindingsByValue)
207208
}
208209
}
209210

211+
if(i === n) return false;
212+
210213
return refBinding;
211214
};
212215

0 commit comments

Comments
 (0)