From 7830a017ade4964743b64431371f340d85741f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Thu, 22 May 2014 16:21:32 +0200 Subject: [PATCH] prevent bug for empty data --- application/core/ManiaExchange/ManiaExchangeManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/core/ManiaExchange/ManiaExchangeManager.php b/application/core/ManiaExchange/ManiaExchangeManager.php index f8867020..e7d1dc48 100644 --- a/application/core/ManiaExchange/ManiaExchangeManager.php +++ b/application/core/ManiaExchange/ManiaExchangeManager.php @@ -248,9 +248,9 @@ class ManiaExchangeManager { trigger_error($error); } else { $mxMapList = json_decode($mapInfo); - if ($mxMapList === null) { + if (!is_array($mxMapList)) { trigger_error('Cannot decode searched JSON data from ' . $url); - } else { + } else if (count($mxMapList) > 0) { $mxMapInfo = new MXMapInfo($titlePrefix, $mxMapList[0]); } }