From 12d88b565f0f48462b2207e1ac3730bb16aa3b92 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Wed, 13 Apr 2016 07:26:17 -0400 Subject: [PATCH] catch AttributeError on metadata with no date (#2469) --- geonode/layers/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/layers/metadata.py b/geonode/layers/metadata.py index 9dcd6ae12b3..2b344e93b79 100644 --- a/geonode/layers/metadata.py +++ b/geonode/layers/metadata.py @@ -219,7 +219,7 @@ def sniff_date(datestr): for dfmt in dateformats: try: return datetime.datetime.strptime(datestr.strip(), dfmt) - except ValueError: + except (AttributeError, ValueError): pass