From b99b8218a34d589fbc9f0bc1c2b2e6415149190e Mon Sep 17 00:00:00 2001 From: matth-x <63792403+matth-x@users.noreply.github.com> Date: Sat, 28 Oct 2023 20:29:27 +0200 Subject: [PATCH] set custom console null check (fixes #224) --- src/MicroOcpp/Platform.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MicroOcpp/Platform.cpp b/src/MicroOcpp/Platform.cpp index 113f451b..5d85ea7e 100644 --- a/src/MicroOcpp/Platform.cpp +++ b/src/MicroOcpp/Platform.cpp @@ -18,7 +18,9 @@ void MicroOcpp::mocpp_console_out(const char *msg) { void mocpp_set_console_out(void (*console_out)(const char *msg)) { MicroOcpp::mocpp_console_out_impl = console_out; - console_out("[OCPP] console initialized\n"); + if (console_out) { + console_out("[OCPP] console initialized\n"); + } } #endif