Skip to content

Commit 19a2d0c

Browse files
authored
Merge pull request #3791 from BsAtHome/fix_tooldata-save
Don't crash milltask when no tool data file is specified
2 parents 9ba3f93 + 26245e2 commit 19a2d0c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/emc/tooldata/tooldata_common.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,13 @@ int tooldata_save(const char *filename)
388388
if (!is_random_toolchanger) {return 0;}
389389
filename = DB_SPINDLE_SAVE; //one entry tbl (nonran only)
390390
} else {
391+
// filename == NULL happens without ini entry [EMCIO]TOOL_TABLE
392+
// and a Task::emcToolSetOffset is performed.
393+
if (!filename) {
394+
fprintf(stderr, "%s: No filename. Are you missing INI-entry [EMCIO]TOOL_TABLE?\n",
395+
__PRETTY_FUNCTION__);
396+
return -1;
397+
}
391398
if (filename[0] == 0) {
392399
UNEXPECTED_MSG;
393400
}

0 commit comments

Comments
 (0)