]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5123] Foctorized calls to get
authorFrancis Dupont <fdupont@isc.org>
Fri, 27 Jan 2017 19:09:12 +0000 (20:09 +0100)
committerFrancis Dupont <fdupont@isc.org>
Fri, 27 Jan 2017 19:09:12 +0000 (20:09 +0100)
src/bin/dhcp6/json_config_parser.cc

index 58649c8ed2512a1b1f4415d262282e3db085645f..de45d87216e5bd2ad41d130e04cd1e7f51f87bc6 100644 (file)
@@ -172,13 +172,15 @@ public:
             excluded_prefix_len = getUint8(pd_pool_, "excluded-prefix-len");
         }
 
-        if (pd_pool_->contains("option-data")) {
+        ConstElementPtr option_data = pd_pool_->get("option-data");
+        if (option_data) {
             OptionDataListParser opts_parser(AF_INET6);
-            opts_parser.parse(options_, pd_pool_->get("option-data"));
+            opts_parser.parse(options_, option_data);
         }
                     
-        if (pd_pool_->contains("user-context")) {
-            user_context_ = pd_pool_->get("user-context");
+        ConstElementPtr user_context = pd_pool_->get("user-context");
+        if (user_context) {
+            user_context_ = user_context;
         }
 
         // Check the pool parameters. It will throw an exception if any