summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--controller/EmbeddedNetworkController.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp
index ce56e906..3be55d8e 100644
--- a/controller/EmbeddedNetworkController.cpp
+++ b/controller/EmbeddedNetworkController.cpp
@@ -1018,9 +1018,10 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
json ntag = json::object();
const uint64_t tagId = OSUtils::jsonInt(tag["id"],0ULL);
ntag["id"] = tagId;
- if (tag.find("default") == tag.end())
- ntag["default"] = json();
- else ntag["default"] = OSUtils::jsonInt(tag["default"],0ULL);
+ json &dfl = tag["default"];
+ if (dfl.is_null())
+ ntag["default"] = dfl;
+ else ntag["default"] = OSUtils::jsonInt(dfl,0ULL);
ntags[tagId] = ntag;
}
}