prevent bug for empty data
This commit is contained in:
parent
255912b335
commit
7830a017ad
@ -248,9 +248,9 @@ class ManiaExchangeManager {
|
|||||||
trigger_error($error);
|
trigger_error($error);
|
||||||
} else {
|
} else {
|
||||||
$mxMapList = json_decode($mapInfo);
|
$mxMapList = json_decode($mapInfo);
|
||||||
if ($mxMapList === null) {
|
if (!is_array($mxMapList)) {
|
||||||
trigger_error('Cannot decode searched JSON data from ' . $url);
|
trigger_error('Cannot decode searched JSON data from ' . $url);
|
||||||
} else {
|
} else if (count($mxMapList) > 0) {
|
||||||
$mxMapInfo = new MXMapInfo($titlePrefix, $mxMapList[0]);
|
$mxMapInfo = new MXMapInfo($titlePrefix, $mxMapList[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user