File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ inline ObjectImpl::iterator ObjectImpl::findKey(TAdaptedString key) const {
3434 bool isKey = true ;
3535 for (auto it = createIterator (); !it.done (); it.next (resources_)) {
3636 VariantImpl variant (it.data (), resources_);
37- if (isKey && stringEquals (key, adaptString (variant.asString ())))
37+ if (isKey && stringEquals (key, adaptString (VariantImpl::asString (
38+ it.data (), resources_))))
3839 return it;
3940 isKey = !isKey;
4041 }
Original file line number Diff line number Diff line change @@ -316,7 +316,16 @@ class VariantImpl {
316316 }
317317
318318 JsonString asString () const {
319- switch (type ()) {
319+ if (!data_)
320+ return JsonString ();
321+ return asString (data_, resources_);
322+ }
323+
324+ static JsonString asString (VariantData* data_, ResourceManager* resources_) {
325+ ARDUINOJSON_ASSERT (data_ != nullptr );
326+ ARDUINOJSON_ASSERT (resources_ != nullptr );
327+
328+ switch (data_->type ) {
320329 case VariantType::TinyString:
321330 return JsonString (data_->content .asTinyString );
322331 case VariantType::LongString:
You can’t perform that action at this time.
0 commit comments