Fix EnhancedChangesList::getDiffHistLinks null exception
authorBrian Wolff <bawolff+wn@gmail.com>
Fri, 19 May 2017 22:08:14 +0000 (22:08 +0000)
committerBrian Wolff <bawolff+wn@gmail.com>
Sun, 21 May 2017 08:50:44 +0000 (08:50 +0000)
If a page is deleted, rc_cur_id is missing, but it takes
a while before job queue deletes RC entries. If we encounter
something like that, just skip it since its bound for
deletion anyways.

Bug: T164059
Change-Id: I286109a9707e54939c0da31656ef54fd29acf481

includes/changes/EnhancedChangesList.php

index b8a2ac8..7e59882 100644 (file)
@@ -712,6 +712,11 @@ class EnhancedChangesList extends ChangesList {
                if ( $rc->getAttribute( 'rc_type' ) == RC_CATEGORIZE ) {
                        // For categorizations we must swap the category title with the page title!
                        $pageTitle = Title::newFromID( $rc->getAttribute( 'rc_cur_id' ) );
+                       if ( !$pageTitle ) {
+                               // The page has been deleted, but the RC entry
+                               // deletion job has not run yet. Just skip.
+                               return '';
+                       }
                }
 
                $retVal = ' ' . $this->msg( 'parentheses' )