diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 7f2ed8172d21..4bd61dd2f569 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1864,11 +1864,13 @@ void Temperature::task() { quickstop_stepper(); } - if (emergency_parser.sd_abort_by_M524) { // abort SD print immediately - emergency_parser.sd_abort_by_M524 = false; - card.flag.abort_sd_printing = true; - gcode.process_subcommands_now(F("M524")); - } + #if ENABLED(SDSUPPORT) + if (emergency_parser.sd_abort_by_M524) { // abort SD print immediately + emergency_parser.sd_abort_by_M524 = false; + card.flag.abort_sd_printing = true; + gcode.process_subcommands_now(F("M524")); + } + #endif #endif if (!updateTemperaturesIfReady()) return; // Will also reset the watchdog if temperatures are ready