Skip to content

Commit 8d72c5e

Browse files
authored
Fix "Uncaught TypeError: is not iterable"
1 parent 673da81 commit 8d72c5e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Resources/queries/widget.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
},
112112

113113
identifyDuplicates: function(statements) {
114+
if (! Array.isArray(statements)) statements = [];
115+
114116
const makeStatementHash = (statement) => {
115117
return [
116118
statement.sql,
@@ -341,8 +343,8 @@
341343
const $li = $('<li />').addClass(csscls('table-list-item'));
342344
const $muted = $('<span />').addClass(css('text-muted'));
343345

344-
let i = 0;
345-
for (const value of values) {
346+
for (const i in values) {
347+
const value = values[i];
346348
if (showLineNumbers) {
347349
$ul.append($li.clone().append([$muted.clone().text(`${i}:`), '&nbsp;', $('<span/>').text(value)]));
348350
} else {
@@ -352,7 +354,6 @@
352354
$ul.append($li.clone().text(value));
353355
}
354356
}
355-
i++;
356357
}
357358

358359
return this.renderDetail(caption, icon, $ul);

0 commit comments

Comments
 (0)