Invalid argument supplied for foreach() in ApiQueryGadgets.php on line 58

Gadget::loadStructuredList() can return false

Bug: 53829
Change-Id: I11f0531711cb431fa9f44c0fece527aea82f6a5a
This commit is contained in:
Reedy 2013-09-11 20:48:15 +01:00
parent bb874dad32
commit 12b2e7dd68

View file

@ -54,6 +54,10 @@ class ApiQueryGadgets extends ApiQueryBase {
private function getList() {
$gadgets = Gadget::loadStructuredList();
if ( $gadgets === false ) {
return array();
}
$result = array();
foreach ( $gadgets as $category => $list ) {
if ( $this->categories && !isset( $this->categories[$category] ) ) {