Follow-up 73ec3a331: fix fatal when no cross-wiki results are found

If we don't initialize $results, getForeignNotifications() will return
null, and this will cause a fatal when trying to += it into an array.

Change-Id: Ibb868cbf0b52ff2de41c5be82c9605801e51ffae
This commit is contained in:
Roan Kattouw 2016-05-05 12:58:28 -07:00
parent 7055f83fe0
commit e57dbfc86b

View file

@ -376,6 +376,7 @@ class ApiEchoNotifications extends ApiQueryBase {
$http = new MultiHttpClient( array() ); $http = new MultiHttpClient( array() );
$responses = $http->runMulti( $reqs ); $responses = $http->runMulti( $reqs );
$results = array();
foreach ( $responses as $wiki => $response ) { foreach ( $responses as $wiki => $response ) {
$statusCode = $response['response']['code']; $statusCode = $response['response']['code'];
if ( $statusCode >= 200 && $statusCode <= 299 ) { if ( $statusCode >= 200 && $statusCode <= 299 ) {