diff --git a/src/main/cpp/json.cpp b/src/main/cpp/json.cpp index 16e0a7d..cbe443a 100644 --- a/src/main/cpp/json.cpp +++ b/src/main/cpp/json.cpp @@ -23,6 +23,10 @@ namespace json { std::string escape_string(const char *str) { + if (!str) { + return ""; + } + std::string result; // Create a sufficient buffer to escape all chars result.reserve(strlen(str) * 2 + 3);