typecast_date(s) in db/backends/util.py crashes if s = None
|Reported by:||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
The error concerns the typecast_date(s) function in django/db/backends/util.py. If s is a NoneType instead of a null, the s.split('-') command causes the function to crash. This causes errors when trying to view some objects in the admin and also has been seen to cause errors with django.views.generic.date_based.archive_index. A simple try & except fixes the problem and doesn't affect normal behavior of the function. A .diff patch is attached.