mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
git-remote-mediawiki: be more defensive when requests fail
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5a29217dda
commit
ff0bfd754d
@ -912,6 +912,14 @@ sub mw_import_revids {
|
||||
|
||||
my $result = $mediawiki->api($query);
|
||||
|
||||
if (!$result) {
|
||||
die "Failed to retrieve modified page for revision $pagerevid";
|
||||
}
|
||||
|
||||
if (!defined($result->{query}->{pages})) {
|
||||
die "Invalid revision $pagerevid.";
|
||||
}
|
||||
|
||||
my @result_pages = values(%{$result->{query}->{pages}});
|
||||
my $result_page = $result_pages[0];
|
||||
my $rev = $result_pages[0]->{revisions}->[0];
|
||||
|
Loading…
Reference in New Issue
Block a user