summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-07-06 18:06:30 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-07-06 18:09:31 -0400
commitf9b6c0053a017125b46014a6b7bb026943bc4405 (patch)
tree8a5f78f271ca0dae007a43b3c0ae8faf12fdc781
parent04ecf7d5fd659314031b3899ff88979a63bb56de (diff)
downloadb4-f9b6c0053a017125b46014a6b7bb026943bc4405.tar.gz
Fix crash when -c used with incomplete series
Return early if we don't have a cover letter or patch 1/X to use as basis for the subject-based query. Reported-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/mbox.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index d40c3df..2391405 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -365,6 +365,10 @@ def get_extra_series(mboxfile, direction=1, wantvers=None, nocache=False):
# A patch/series without a cover letter
base_msg = msg
+ if base_msg is None:
+ logger.debug('Could not find cover of 1st patch in mbox')
+ mbx.close()
+ return
# Get subject info from base_msg again
lsub = b4.LoreSubject(base_msg['Subject'])
if not len(lsub.prefixes):