Diff

util/filters.lua @ 3139:7b4f180d7c6f

util.filters: Don't traceback with no filters of a type added
author Matthew Wild <mwild1@gmail.com>
date Wed, 02 Jun 2010 13:03:55 +0100
parent 3135:f29a297471e3
child 3140:8c6ed6fd2d35
line wrap: on
line diff
--- 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