diff -r 92354fdeb9ca django/template/defaultfilters.py
--- a/django/template/defaultfilters.py	Sun Sep 13 12:22:17 2009 -0400
+++ b/django/template/defaultfilters.py	Sun Sep 13 12:22:41 2009 -0400
@@ -468,8 +468,12 @@
     the argument.
     """
     var_resolve = Variable(arg).resolve
-    decorated = [(var_resolve(item), item) for item in value]
-    decorated.sort()
+    try:
+        decorated = [(var_resolve(item), item) for item in value]
+        decorated.sort()
+    except TypeError:
+        decorated = []
+
     return [item[1] for item in decorated]
 dictsort.is_safe = False
 
