Merge "ApiQueryWatchlist: Handle empty wltypes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 21 Dec 2016 05:34:04 +0000 (05:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 21 Dec 2016 05:34:04 +0000 (05:34 +0000)
includes/api/ApiQueryWatchlist.php

index 6b5ceb7..3f59751 100644 (file)
@@ -151,7 +151,10 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
 
                if ( !is_null( $params['type'] ) ) {
                        try {
-                               $options['rcTypes'] = RecentChange::parseToRCType( $params['type'] );
+                               $rcTypes = RecentChange::parseToRCType( $params['type'] );
+                               if ( $rcTypes ) {
+                                       $options['rcTypes'] = $rcTypes;
+                               }
                        } catch ( Exception $e ) {
                                ApiBase::dieDebug( __METHOD__, $e->getMessage() );
                        }