summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-20 23:48:44 -0500
committerDan McGee <dan@archlinux.org>2012-08-20 23:48:44 -0500
commit78553abc51ba0f18e1c3bec015c9a11d4760c522 (patch)
tree71e96853d8dbc68463beae6aff143b90fda7f553 /main/models.py
parentf7289625000d0f83675fc5a70650b49707338dca (diff)
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/models.py')
-rw-r--r--main/models.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 014464ff..42f8e89a 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]