From c07ca14e203e19169ffe0e259a3a4dfa35c9e4fc Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Mon, 14 Nov 2022 14:40:08 +0100 Subject: [PATCH] fix crash if SD enabled but not inserted and sleep --- src/sdcard.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sdcard.cpp b/src/sdcard.cpp index 54414233..6e92190e 100644 --- a/src/sdcard.cpp +++ b/src/sdcard.cpp @@ -216,6 +216,8 @@ void sdcard_flush(void) { } void sdcard_close(void) { + if (!useSDCard) + return; ESP_LOGI(TAG, "closing SD-card"); sdcard_flush(); #ifdef SD_LOGGING