fix for empty salias
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 19 Jan 2012 15:40:51 +0000 (16:40 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 19 Jan 2012 15:40:51 +0000 (16:40 +0100)
librarian/dcparser.py

index f64317a..5a571ec 100644 (file)
@@ -248,7 +248,7 @@ class WorkInfo(object):
                 if not field.multiple:
                     raise "OUCH!! for field %s" % name
 
                 if not field.multiple:
                     raise "OUCH!! for field %s" % name
 
-                return value[0]
+                return value[0] if value else None
         except (KeyError, AttributeError):
             return object.__getattribute__(self, name)
 
         except (KeyError, AttributeError):
             return object.__getattribute__(self, name)