]> granicus.if.org Git - ejabberd/commitdiff
Force PEP parent node to be []
authorChristophe Romain <christophe.romain@process-one.net>
Thu, 10 Jan 2008 17:38:24 +0000 (17:38 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Thu, 10 Jan 2008 17:38:24 +0000 (17:38 +0000)
SVN Revision: 1144

src/mod_pubsub/nodetree_default.erl

index a7360bc212a6e9e82a3e3c12145a1d784ea28631..3c8a63e6b5ccd106995101981f422b3c927e3569 100644 (file)
@@ -144,11 +144,15 @@ create_node(Key, Node, Type, Owner, Options) ->
                        {[], true};
                    _ ->
                        Parent = lists:sublist(Node, length(Node) - 1),
-                       (Parent == []) orelse
+                       case Parent of
+                       [] -> 
+                           {[], true};
+                       _ ->
                            case mnesia:read({pubsub_node, {Key, Parent}}) of
                                [] -> {Parent, false};
                                _ -> {Parent, true}
                            end
+                       end
                end,
            case ParentExists of
                true ->