8000 Add check for null or undefined points · edkeeble/plotly.js@f3b679f · GitHub
[go: up one dir, main page]

Skip to content

Commit f3b679f

Browse files
committed
Add check for null or undefined points
1 parent b5309ec commit f3b679f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/plots/cartesian/set_convert.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,13 @@ module.exports = function setConvert(ax) {
184184
// that aren't in the first etc.
185185
// TODO: sorting options - do the sorting
186186
// progressively here as we insert?
187-
if(ax._categories.indexOf(v)===-1) ax._categories.push(v);
188187

189-
var c = ax._categories.indexOf(v);
190-
return c===-1 ? constants.BADNUM : c;
188+
if(v !== null && v !== undefined && ax._categories.indexOf(v) === -1){
189+
ax._categories.push(v);
190+
return ax._categories.length - 1;
191+
}else{
192+
return constants.BADNUM;
193+
}
191194
};
192195

193196
ax.d2l = ax.d2c;

0 commit comments

Comments
 (0)
0