We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f08825d commit 3af3a1aCopy full SHA for 3af3a1a
src/FirebaseArduino.cpp
@@ -179,7 +179,12 @@ FirebaseObject FirebaseArduino::readEvent() {
179
String event = client->readStringUntil('\n').substring(6);
180
client->readStringUntil('\n'); // consume separator
181
FirebaseObject obj = FirebaseObject(event.c_str());
182
- obj.getJsonVariant().as<JsonObject&>().set("type", type);
+
183
+ // required to have a copy of the string but use a char[] format which is
184
+ // the only supported format for JsonObject#set (it does not like the std::string of the test env)
185
+ char *cstr = new char[type.length() + 1];
186
+ strcpy(cstr, type.c_str());
187
+ obj.getJsonVariant().as<JsonObject&>().set("type", cstr);
188
return obj;
189
}
190
0 commit comments