Преглед на файлове

[jb] Fix page crash when stdout is empty

Romain Rigaux преди 13 години
родител
ревизия
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)
     et = lxml.html.parse(data)
     log_sections = et.findall('body/pre')
     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:
     if len(logs) < 3:
       LOGGER.warn('Error parsing task attempt log for %s at "%s". Found %d (not 3) log sections' %
       LOGGER.warn('Error parsing task attempt log for %s at "%s". Found %d (not 3) log sections' %
                   (self.attemptId, url, len(log_sections)))
                   (self.attemptId, url, len(log_sections)))