From f8b5ba9a6dafc56822c3ac31053d3e94795108eb Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 13 May 2020 17:04:55 -0400 Subject: Fix crasher for incomplete threads Don't crash if the message in the References: is not available in the thread. Reported-by: Bjorn Helgaas Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/b4/__init__.py b/b4/__init__.py index 3ed8244..ad417e6 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: -- cgit v1.2.3