]> granicus.if.org Git - icinga2/commitdiff
Fix problem with child nodes in http url registry
authorMichael Friedrich <michael.friedrich@netways.de>
Wed, 22 Jul 2015 10:23:56 +0000 (12:23 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 22 Jul 2015 10:27:07 +0000 (12:27 +0200)
fixes #9703

lib/remote/httphandler.cpp

index d785952acc528318cc254274866fe118d286d0e0..9716805d764dc38435c51efcd9ee99a1678aa617 100644 (file)
@@ -39,8 +39,11 @@ void HttpHandler::Register(const Url::Ptr& url, const HttpHandler::Ptr& handler)
                        node->Set("children", children);
                }
 
-               Dictionary::Ptr sub_node = new Dictionary();
-               children->Set(elem, sub_node);
+               Dictionary::Ptr sub_node = children->Get(elem);
+               if (!sub_node) {
+                       sub_node = new Dictionary();
+                       children->Set(elem, sub_node);
+               }
 
                node = sub_node;
        }