- ApiQueryBase::addTitleInfo( $r, $title );
- $r['revisions'] = intval( $successCount );
+
+ if ( $title === null ) {
+ # Invalid or non-importable title
+ $r['title'] = $pageInfo['title'];
+ $r['invalid'] = '';
+ } else {
+ ApiQueryBase::addTitleInfo( $r, $title );
+ $r['revisions'] = intval( $successCount );
+ }
+