summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/tgbot/TgTypeParser.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h
index 6670753..5961bbe 100644
--- a/include/tgbot/TgTypeParser.h
+++ b/include/tgbot/TgTypeParser.h
@@ -494,7 +494,13 @@ private:
json += ',';
}
- inline void appendToJson(std::string& json, const std::string& varName, const char *value) const { appendToJson(json, varName, std::string(value)); }
+ inline void appendToJson(std::string& json, const std::string& varName, const char* value) const {
+ if (value != nullptr){
+ std::string strValue(value);
+ appendToJson(json, varName, strValue);
+ }
+ }
+
void appendToJson(std::string& json, const std::string& varName, const std::string& value) const;
};