Browse Source

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>
maint
Matthieu Moy 13 years ago committed by Junio C Hamano
parent
commit
ff0bfd754d
  1. 8
      contrib/mw-to-git/git-remote-mediawiki

8
contrib/mw-to-git/git-remote-mediawiki

@ -912,6 +912,14 @@ sub mw_import_revids { @@ -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…
Cancel
Save