Skip to content

Commit ced0adc

Browse files
k-risterclaude
andcommitted
fix: use isDefined() instead of comparing against string 'undefined'
Comparing sets[i].breakout != 'undefined' checks against the literal string, not the undefined type. When breakout is actually undefined, the comparison is true (different types), causing .length to be called on undefined (TypeError). Use the existing isDefined() helper which does typeof correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3279c18 commit ced0adc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

queries/cdmq/cdm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3605,7 +3605,7 @@ getMetricDataSets = async function (instance, sets, yearDotMonth) {
36053605

36063606
// Ensure that any breakouts are available for each set
36073607
for (var i = 0; i < sets.length; i++) {
3608-
if (sets[i].breakout != 'undefined') {
3608+
if (isDefined(sets[i].breakout)) {
36093609
for (var j = 0; j < sets[i].breakout.length; j++) {
36103610
var breakout = parseBreakoutEntry(sets[i].breakout[j]).name;
36113611
if (!setBreakouts[i].includes(breakout)) {

0 commit comments

Comments
 (0)