aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-13 17:04:55 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-13 17:04:55 -0400
commitdd00e0fec2bb9fca72264754883dce655b5b411a (patch)
tree29dd0c8bfbc47d58fc99b8fe16495d705d701a05
parent585f17c82f472991568d058dc24ec44668968a32 (diff)
downloadb4-dd00e0fec2bb9fca72264754883dce655b5b411a.tar.gz
Fix crasher for incomplete threads
Don't crash if the message in the References: is not available in the thread. Reported-by: Bjorn Helgaas <helgaas@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index bf4898b..ecd746f 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -275,8 +275,11 @@ class LoreMailbox:
if pmsg is None:
# Can't find the message we're replying to here
continue
- else:
+ elif fmsg.in_reply_to in self.msgid_map:
pmsg = self.msgid_map[fmsg.in_reply_to]
+ else:
+ logger.debug(' missing message, skipping: %s', fmsg.in_reply_to)
+ continue
trailers, mismatches = fmsg.get_trailers(sloppy=sloppytrailers)
for tname, tvalue in mismatches: