diff options
author | Matthieu Moy <Matthieu.Moy@imag.fr> | 2012-07-06 12:03:15 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-06 12:20:46 -0700 |
commit | ff0bfd754d621ae267861441f7b525dff1b0ab27 (patch) | |
tree | b8eee22ae736be2f9d64f5d98ea4f4a0efc6fa0c | |
parent | 5a29217dda0625707a46f527d17489c0bff0c2c9 (diff) | |
download | git-ff0bfd754d621ae267861441f7b525dff1b0ab27.tar.gz |
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>
-rwxr-xr-x | contrib/mw-to-git/git-remote-mediawiki | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki index 6bf1d1ad44..ff9384e91b 100755 --- a/contrib/mw-to-git/git-remote-mediawiki +++ b/contrib/mw-to-git/git-remote-mediawiki @@ -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]; |