Skip to content

Commit b0689f1

Browse files
committed
Fixed debug console error w/ M03 w/o spindle speed #34
1 parent c95391d commit b0689f1

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/views/providers/gcodeTreeParser.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,15 @@ export class GCodeTreeParser {
391391
} else {
392392
x = -1;
393393
}
394+
394395
node = new NavTreeNode(
395-
`Spindle On ${words[i + x].substr(1)}RPM` + ' CW',
396+
`Spindle On ${words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)}RPM` +
397+
' CW',
396398
TreeItemCollapsibleState.None,
397399
);
398-
node.tooltip = `Spindle On Clockwise (${words[i + x].substr(1)}RPM)`;
400+
node.tooltip = `Spindle On Clockwise (${
401+
words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)
402+
}RPM)`;
399403
node.setIcon(IconType.SpindleCW);
400404
node.command = {
401405
command: 'gcode.views.navTree.select',
@@ -415,10 +419,13 @@ export class GCodeTreeParser {
415419
x = -1;
416420
}
417421
node = new NavTreeNode(
418-
`Spindle On ${words[i + x].substr(1)}RPM` + ' CCW',
422+
`Spindle On ${words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)}RPM` +
423+
' CCW',
419424
TreeItemCollapsibleState.None,
420425
);
421-
node.tooltip = `Spindle On Counter Clockwise (${words[i + x].substr(1)}RPM)`;
426+
node.tooltip = `Spindle On Counter Clockwise (${
427+
words[i + x].substr(1) === undefined ? '' : words[i + x].substr(1)
428+
}RPM)`;
422429
node.setIcon(IconType.SpindleCCW);
423430
node.command = {
424431
command: 'gcode.views.navTree.select',

0 commit comments

Comments
 (0)