diff --git a/django/template/base.py b/django/template/base.py
index b608367..8d8ac35 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -767,7 +767,7 @@ class Variable(object):
             for bit in self.lookups:
                 try:  # dictionary lookup
                     current = current[bit]
-                except (TypeError, AttributeError, KeyError, ValueError):
+                except (TypeError, AttributeError, KeyError, ValueError, IndexError):
                     try:  # attribute lookup
                         # Don't return class attributes if the class is the context:
                         if isinstance(current, BaseContext) and getattr(type(current), bit):
