* [PATCH] extmsg: avoid exceptions when /all/$MSGID/ fails
@ 2020-12-10 23:04 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-12-10 23:04 UTC (permalink / raw)
To: meta
If a message can't be found in ->ALL, we shouldn't attempt to
enter code paths which iterate normal inboxes or attempt to
access non-existent fields (e.g. {name}, {newsgroup},
{inboxdir}) in the ExtSearch object.
---
lib/PublicInbox/ExtMsg.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm
index 8da96df6..6a173f67 100644
--- a/lib/PublicInbox/ExtMsg.pm
+++ b/lib/PublicInbox/ExtMsg.pm
@@ -107,7 +107,8 @@ sub ext_msg_ALL ($) {
my ($ctx) = @_;
my $ALL = $ctx->{www}->{pi_cfg}->ALL or return;
my $by_eidx_key = $ctx->{www}->{pi_cfg}->{-by_eidx_key};
- my $cur_key = $ctx->{ibx}->eidx_key;
+ my $cur_key = eval { $ctx->{ibx}->eidx_key } //
+ return partial_response($ctx); # $cur->{ibx} == $ALL
my %seen = ($cur_key => 1);
my ($id, $prev);
while (my $x = $ALL->over->next_by_mid($ctx->{mid}, \$id, \$prev)) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-10 23:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10 23:04 [PATCH] extmsg: avoid exceptions when /all/$MSGID/ fails Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).