浏览代码

[jb] Fix page crash when stdout is empty

Romain Rigaux 12 年之前
父节点
当前提交
da58907c98
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      apps/jobbrowser/src/jobbrowser/models.py

+ 1 - 1
apps/jobbrowser/src/jobbrowser/models.py

@@ -451,7 +451,7 @@ class TaskAttempt(object):
 
     et = lxml.html.parse(data)
     log_sections = et.findall('body/pre')
-    logs = [ section.text for section in log_sections ]
+    logs = [section.text or '' for section in log_sections]
     if len(logs) < 3:
       LOGGER.warn('Error parsing task attempt log for %s at "%s". Found %d (not 3) log sections' %
                   (self.attemptId, url, len(log_sections)))