Handle exceptions when testing row validity
authorErik Bernhardson <ebernhardson@wikimedia.org>
Fri, 7 Mar 2014 03:31:16 +0000 (19:31 -0800)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Fri, 7 Mar 2014 03:34:01 +0000 (19:34 -0800)
This bit of special contributions, according to its comment, is
intentionally ignoring errors.  Also swallow exceptions with the
same expectations.

Change-Id: I82ceb0b223159c71796f64a890cf6209a6544209

includes/specials/SpecialContributions.php

index fdb781b..636e796 100644 (file)
@@ -941,8 +941,12 @@ class ContribsPager extends ReverseChronologicalPager {
                 * to extensions to subscribe to the hook to parse the row.
                 */
                wfSuppressWarnings();
-               $rev = new Revision( $row );
-               $validRevision = (bool)$rev->getId();
+               try {
+                       $rev = new Revision( $row );
+                       $validRevision = (bool)$rev->getId();
+               } catch ( MWException $e ) {
+                       $validRevision = false;
+               }
                wfRestoreWarnings();
 
                if ( $validRevision ) {