diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 673a46dae..f3588fd28 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5518,8 +5518,8 @@ inline void gcode_M140() { * F */ inline void gcode_M145() { - int8_t material = code_seen('S') ? (int8_t)code_value_int() : 0; - if (material < 0 || material >= COUNT(lcd_preheat_hotend_temp)) { + uint8_t material = code_seen('S') ? (uint8_t)code_value_int() : 0; + if (material >= COUNT(lcd_preheat_hotend_temp)) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_MATERIAL_INDEX); }