From 26245e2fbfc522cd4853dab65ecdc57453092199 Mon Sep 17 00:00:00 2001 From: Bertho Stultiens Date: Fri, 6 Feb 2026 17:35:05 +0100 Subject: [PATCH] milltask: Don't crash when no tool data file specified. --- src/emc/tooldata/tooldata_common.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/emc/tooldata/tooldata_common.cc b/src/emc/tooldata/tooldata_common.cc index a6fea970be0..df56b01c73e 100644 --- a/src/emc/tooldata/tooldata_common.cc +++ b/src/emc/tooldata/tooldata_common.cc @@ -388,6 +388,13 @@ int tooldata_save(const char *filename) if (!is_random_toolchanger) {return 0;} filename = DB_SPINDLE_SAVE; //one entry tbl (nonran only) } else { + // filename == NULL happens without ini entry [EMCIO]TOOL_TABLE + // and a Task::emcToolSetOffset is performed. + if (!filename) { + fprintf(stderr, "%s: No filename. Are you missing INI-entry [EMCIO]TOOL_TABLE?\n", + __PRETTY_FUNCTION__); + return -1; + } if (filename[0] == 0) { UNEXPECTED_MSG; }