diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index cad57a5..8ecec94 100644
a
|
b
|
class RegexURLResolver(object):
|
183 | 183 | else: |
184 | 184 | bits = normalize(p_pattern) |
185 | 185 | lookups.appendlist(pattern.callback, (bits, p_pattern)) |
186 | | lookups.appendlist(pattern.name, (bits, p_pattern)) |
| 186 | if pattern.name is not None: |
| 187 | lookups.appendlist(pattern.name, (bits, p_pattern)) |
187 | 188 | self._reverse_dict = lookups |
188 | 189 | self._namespace_dict = namespaces |
189 | 190 | self._app_dict = apps |
diff --git a/tests/regressiontests/urlpatterns_reverse/tests.py b/tests/regressiontests/urlpatterns_reverse/tests.py
index 3fcc935..98fc61f 100644
a
|
b
|
class URLPatternReverse(TestCase):
|
118 | 118 | self.assertEqual(expected, NoReverseMatch) |
119 | 119 | else: |
120 | 120 | self.assertEquals(got, expected) |
| 121 | |
| 122 | def test_reverse_none(self): |
| 123 | # Reversing None should raise an error, not return the last un-named |
| 124 | # view. |
| 125 | self.assertRaises(NoReverseMatch, reverse, None) |
121 | 126 | |
122 | 127 | class ResolverTests(unittest.TestCase): |
123 | 128 | def test_non_regex(self): |