util.filters: Don't traceback with no filters of a type added
authorMatthew Wild <mwild1@gmail.com>
Wed, 02 Jun 2010 13:03:55 +0100
changeset 3139 7b4f180d7c6f
parent 3138 d6151c9a6f7e
child 3140 8c6ed6fd2d35
util.filters: Don't traceback with no filters of a type added
util/filters.lua
--- a/util/filters.lua	Wed Jun 02 17:25:01 2010 +0500
+++ b/util/filters.lua	Wed Jun 02 13:03:55 2010 +0100
@@ -16,8 +16,10 @@
 	
 	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