summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-21 06:48:44 +0200
committerDan McGee <dan@archlinux.org>2012-08-21 06:48:44 +0200
commit78553abc51ba0f18e1c3bec015c9a11d4760c522 (patch)
tree71e96853d8dbc68463beae6aff143b90fda7f553 /main
parentf7289625000d0f83675fc5a70650b49707338dca (diff)
downloadarchweb-78553abc51ba0f18e1c3bec015c9a11d4760c522.tar.gz
archweb-78553abc51ba0f18e1c3bec015c9a11d4760c522.tar.xz
Don't blow up when pgp signature data is '' on a package
We handled None/NULL correctly, but not the empty string. Fix this corner case. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/models.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 014464f..42f8e89 100644
--- a/main/models.py
+++ b/main/models.py
@@ -143,6 +143,8 @@ class Package(models.Model):
data = b64decode(self.pgp_signature)
except TypeError:
return None
+ if not data:
+ return None
data = BinaryData(data)
packets = list(data.packets())
return packets[0]