aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-06-02 12:24:07 +0100
committerMatthew Wild <mwild1@gmail.com>2010-06-02 12:24:07 +0100
commitb5d2e584f484c5064973915060572961de143709 (patch)
tree44a2b255eb93851bd55e6f09af23cef37051abdc /util
parentac72ecb7fd942b5cb50be1c19a711907ec3a79ce (diff)
downloadprosody-b5d2e584f484c5064973915060572961de143709.tar.gz
prosody-b5d2e584f484c5064973915060572961de143709.zip
util.filters: Don't traceback when trying to remove a filter from an uninitialized object
Diffstat (limited to 'util')
-rw-r--r--util/filters.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/filters.lua b/util/filters.lua
index af5b8d2d..123226c5 100644
--- a/util/filters.lua
+++ b/util/filters.lua
@@ -46,6 +46,7 @@ function add_filter(session, type, callback, priority)
end
function remove_filter(session, type, callback)
+ if not session.filters then return; end
local filter_list = session.filters[type];
if filter_list and filter_list[callback] then
for i=1, #filter_list do