From: Christophe Romain Date: Thu, 10 Jan 2008 17:38:24 +0000 (+0000) Subject: Force PEP parent node to be [] X-Git-Tag: v2.0.0~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09fa4a0ca73f6b0f73ffaa11d3b0f6e49a1a3a39;p=ejabberd Force PEP parent node to be [] SVN Revision: 1144 --- diff --git a/src/mod_pubsub/nodetree_default.erl b/src/mod_pubsub/nodetree_default.erl index a7360bc21..3c8a63e6b 100644 --- a/src/mod_pubsub/nodetree_default.erl +++ b/src/mod_pubsub/nodetree_default.erl @@ -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 ->