File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -261,8 +261,26 @@ pbmessages::MemberChange_Member* memberFromJson(const nlohmann::json& j)
261261 }
262262 }
263263 m->set_active_bridge (j.value (" activeBridge" , false ));
264- m->set_tags (OSUtils::jsonDump (j.value (" tags" , nlohmann::json::array ()), -1 ));
265- m->set_capabilities (OSUtils::jsonDump (j.value (" capabilities" , nlohmann::json::array ()), -1 ));
264+ if (j[" tags" ].is_array ()) {
265+ nlohmann::json tags = j[" tags" ];
266+ std::string tagsStr = OSUtils::jsonDump (tags, -1 );
267+ m->set_tags (tagsStr);
268+ }
269+ else {
270+ nlohmann::json tags = nlohmann::json::array ();
271+ std::string tagsStr = OSUtils::jsonDump (tags, -1 );
272+ m->set_tags (tagsStr);
273+ }
274+ if (j[" capabilities" ].is_array ()) {
275+ nlohmann::json caps = j[" capabilities" ];
276+ std::string capsStr = OSUtils::jsonDump (caps, -1 );
277+ m->set_capabilities (capsStr);
278+ }
279+ else {
280+ nlohmann::json caps = nlohmann::json::array ();
281+ std::string capsStr = OSUtils::jsonDump (caps, -1 );
282+ m->set_capabilities (capsStr);
283+ }
266284 m->set_creation_time (j.value (" creationTime" , 0 ));
267285 m->set_no_auto_assign_ips (j.value (" noAutoAssignIps" , false ));
268286 m->set_revision (j.value (" revision" , 0 ));
You can’t perform that action at this time.
0 commit comments