From bde4b7b05745de5161ff72e9b5e4e0cf5be32992 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Fri, 6 Nov 2009 14:36:41 +0000 Subject: [PATCH] minor bug fixes related to the use/conversion of/to exmpp (thanks to Karim Gemayel) SVN Revision: 2733 --- src/mod_pubsub/pubsub_subscription_odbc.erl | 31 +++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/mod_pubsub/pubsub_subscription_odbc.erl b/src/mod_pubsub/pubsub_subscription_odbc.erl index 4fb459424..3311adf71 100644 --- a/src/mod_pubsub/pubsub_subscription_odbc.erl +++ b/src/mod_pubsub/pubsub_subscription_odbc.erl @@ -132,20 +132,23 @@ get_options_xform(Lang, Options) -> children = [?XMLCDATA(?NS_PUBSUB_SUBSCRIBE_OPTIONS_s)]}]}] ++ XFields}}. parse_options_xform(XFields) -> - case exmpp_xml:get_child_elements(XFields) of - [] -> {result, []}; - [#xmlel{name = 'x'} = XEl] -> - case jlib:parse_xdata_submit(XEl) of - XData when is_list(XData) -> - case set_xoption(XData, []) of - Opts when is_list(Opts) -> {result, Opts}; - Other -> Other - end; - Other -> - Other - end; - Other -> - Other + case XFields of + [] -> {result, []}; + _ -> case exmpp_xml:get_child_elements(XFields) of + [] -> {result, []}; + [#xmlel{name = 'x'} = XEl] -> + case jlib:parse_xdata_submit(XEl) of + XData when is_list(XData) -> + case set_xoption(XData, []) of + Opts when is_list(Opts) -> {result, Opts}; + Other -> Other + end; + Other -> + Other + end; + Other -> + Other + end end. %%====================================================================