<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -723,8 +723,11 @@ set_subscriptions(NodeId, Owner, Subscriptions) -&gt;
 %% ```get_states(NodeId) -&gt;
 %%	   node_default:get_states(NodeId).'''&lt;/p&gt;
 get_states(NodeId) -&gt;
-    States = mnesia:match_object(
-	       #pubsub_state{stateid = {'_', NodeId}, _ = '_'}),
+    States = case catch mnesia:match_object(
+	       #pubsub_state{stateid = {'_', NodeId}, _ = '_'}) of
+	List when is_list(List) -&gt; List;
+	_ -&gt; []
+    end,
     {result, States}.
 
 %% @spec (NodeId, JID) -&gt; [State] | []
@@ -734,7 +737,7 @@ get_states(NodeId) -&gt;
 %% @doc &lt;p&gt;Returns a state (one state list), given its reference.&lt;/p&gt;
 get_state(NodeId, JID) -&gt;
     StateId = {JID, NodeId},
-    case mnesia:read({pubsub_state, StateId}) of
+    case catch mnesia:read({pubsub_state, StateId}) of
 	[State] when is_record(State, pubsub_state) -&gt; State;
 	_ -&gt; #pubsub_state{stateid=StateId}
     end.</diff>
      <filename>src/mod_pubsub/node_hometree.erl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e97e7274b39eb114345259ac2f7148c057e67651</id>
    </parent>
  </parents>
  <author>
    <name>cromain</name>
    <email>cromain@1613c18e-e6f4-0310-972c-c3fad1d2be73</email>
  </author>
  <url>http://github.com/bjc/ejabberd/commit/448ee7677cc2a06354140b948e3125d30f56c42d</url>
  <id>448ee7677cc2a06354140b948e3125d30f56c42d</id>
  <committed-date>2009-07-08T07:28:22-07:00</committed-date>
  <authored-date>2009-07-08T07:28:22-07:00</authored-date>
  <message>prevent creating badxml when pubsub_state is not accessible

git-svn-id: https://svn.process-one.net/ejabberd/trunk@2360 1613c18e-e6f4-0310-972c-c3fad1d2be73</message>
  <tree>bc0ee1e97d3e75f6aab42b6e1acfaa7afcc4242c</tree>
  <committer>
    <name>cromain</name>
    <email>cromain@1613c18e-e6f4-0310-972c-c3fad1d2be73</email>
  </committer>
</commit>
