From e7627208baf6669248953b5b07aa67d0724dea75 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 15 Nov 2009 22:29:24 +0000 Subject: [PATCH] Handling of empty results --- inc/libs/yoomedia_functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 1f67e9ba00..db35fbbb4c 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -169,6 +169,13 @@ function YOOMEDIA_PARSE_RESPONSE ($response, $type) { } // END - if } // END - foreach + // If we have no result, abort here + if (count($dummy) == 0) { + // Empty response from API + logDebugMessage(__FUNCTION__, __LINE__, 'Empy result from API received.'); + return array(); + } // END - if + // The result is now still raw, so we must split it up and trim spaces away $responseLine = trim(implode("\n", $dummy)); -- 2.39.5