From ac74786c2be127d9ab77e1f556f3847c07c74335 Mon Sep 17 00:00:00 2001
From: ellensp <ellensp@hotmail.com>
Date: Thu, 12 Nov 2020 09:35:13 +1300
Subject: [PATCH] Fix compile with PLR, no fan (#20096)

---
 Marlin/src/feature/powerloss.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp
index 874bcff46da..bef2309449d 100644
--- a/Marlin/src/feature/powerloss.cpp
+++ b/Marlin/src/feature/powerloss.cpp
@@ -433,13 +433,15 @@ void PrintJobRecovery::resume() {
   #endif
 
   // Restore print cooling fan speeds
-  FANS_LOOP(i) {
-    uint8_t f = info.fan_speed[i];
-    if (f) {
-      sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f);
-      gcode.process_subcommands_now(cmd);
+  #if HAS_FAN
+    FANS_LOOP(i) {
+      const int f = info.fan_speed[i];
+      if (f) {
+        sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f);
+        gcode.process_subcommands_now(cmd);
+      }
     }
-  }
+  #endif
 
   // Restore retract and hop state
   #if ENABLED(FWRETRACT)