Handle security bugs better.
authorJason Duell <jduell@mozilla.com>
Fri, 15 Feb 2013 00:24:06 -0500
changeset 70 6fe550e5b4e3
parent 69 d2f36f9b40d9
child 71 34334b242ec7
push id51
push userjosh@joshmatthews.net
push date2013-02-15 05:24 +0000
Handle security bugs better.
bz.py
--- a/bz.py
+++ b/bz.py
@@ -234,17 +234,18 @@ class Comment(object):
     self.text = node.find('thetext').text
 
 class Bug(object):
   def __init__(self, ui, data):
     self.settings = Settings(ui)
     xml = xmlfromstring(data)
     bug = xml.find("bug")
     self.num = int(bug.find('bug_id').text)
-    self.title = bug.find('short_desc').text
+    sdesc = bug.find('short_desc')
+    self.title = sdesc.text if sdesc else "[empty]"
     self.comments = [Comment(n) for n in xml.findall("bug/long_desc")]
     self.desc = self.comments[0].text if len(self.comments)>0 else ""
     self.attachments = [Attachment.parse(self, a) for a in xml.findall("bug/attachment")]
     if bug.get("error") == "NotPermitted":
       raise PermissionError("Not allowed to access bug.  (Perhaps it is marked with a security group?)")
 
     # Add to cache so we can avoid network lookup later in this process
     cache[self.num] = self