Bug 725478 - Fix possible access on None; r=losing

This commit is contained in:
Gregory Szorc 2012-02-27 15:32:56 -08:00
parent 52aa0b3db4
commit a0ea1a8d74

View File

@ -464,7 +464,9 @@ class XPCShellTests(object):
failure.setAttribute("message", result["failure"]["message"])
# Lossy translation but required to not break CDATA.
cdata = result["failure"]["text"].replace("]]>", "]] >")
cdata = result["failure"]["text"]
if cdata is not None:
cdata = cdata.replace("]]>", "]] >")
text = doc.createCDATASection(cdata)
failure.appendChild(text)
testcase.appendChild(failure)