Handling of empty results
authorRoland Häder <roland@mxchange.org>
Sun, 15 Nov 2009 22:29:24 +0000 (22:29 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 15 Nov 2009 22:29:24 +0000 (22:29 +0000)
inc/libs/yoomedia_functions.php

index 1f67e9b..db35fbb 100644 (file)
@@ -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));