aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-06-02 13:03:55 +0100
committerMatthew Wild <mwild1@gmail.com>2010-06-02 13:03:55 +0100
commitfaf2be988f1e0f39490ad64e8c6781e6eece30a9 (patch)
treee9ed083b64f9cb0d9907dae606d134250ddf93e3
parent961f01d6e9cac747e90c9509e64083116fef66cd (diff)
downloadprosody-faf2be988f1e0f39490ad64e8c6781e6eece30a9.tar.gz
prosody-faf2be988f1e0f39490ad64e8c6781e6eece30a9.zip
util.filters: Don't traceback with no filters of a type added
-rw-r--r--util/filters.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/filters.lua b/util/filters.lua
index 123226c5..ee0e6bba 100644
--- a/util/filters.lua
+++ b/util/filters.lua
@@ -16,8 +16,10 @@ function initialize(session)
function session.filter(type, data)
local filter_list = filters[type];
- for i = 1, #filter_list do
- data = filter_list[i](data);
+ if filter_list then
+ for i = 1, #filter_list do
+ data = filter_list[i](data);
+ end
end
return data;
end