summaryrefslogtreecommitdiff
path: root/app-portage/elogviewer/files/elogviewer-3.0-segfault.patch
blob: cc67a0d6f1989415a4753e478eb7d90ca7dbe11f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- a/elogviewer.py	2020-05-08 20:23:04.419257166 -0700
+++ b/elogviewer.py	2020-05-08 20:23:30.436359552 -0700
@@ -255,15 +255,22 @@
         return "</h2>"
 
     def parse(self, line):
-        eclass, stage = line.split(":")
-        self.context.eclass = {
-            "ERROR": EClass.Error,
-            "WARN": EClass.Warning,
-            "LOG": EClass.Log,
-            "INFO": EClass.Info,
-            "QA": EClass.QA,
-        }[eclass]
-        return "{}: {}".format(self.context.eclass.name, stage)
+        if not line:
+            return
+        parts = line.split(":")
+        if len(parts) == 2:
+            eclass, stage = parts[0:2]
+            self.context.eclass = {
+                "ERROR": EClass.Error,
+                "WARN": EClass.Warning,
+                "LOG": EClass.Log,
+                "INFO": EClass.Info,
+                "QA": EClass.QA,
+            }[eclass]
+            return "{}: {}".format(self.context.eclass.name, stage)
+        elif len(parts) > 2:
+            # Return an empty string, eclass and stage are populated anyway
+            return "" 
 
 
 class BodyState(AbstractState):