1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

Fix latest Scrutinizer reported errors

This commit is contained in:
Afterster 2014-07-10 07:25:15 +02:00
parent 80cd08ed04
commit 504013ae66
6 changed files with 24 additions and 23 deletions

View file

@ -86,13 +86,14 @@ $rootMediaItems[] = Upnp_Api::_videoMetadata('');
}
$totMatches = count($items);
if ($totMatches == 0) {
if ($items == null || $totMatches == 0) {
$domDIDL = Upnp_Api::createDIDL('');
$numRet = 0;
} else {
if ($upnpRequest['requestedcount'] == 0) {
$upnpRequest['requestedcount'] = $totMatches - $upnpRequest['startingindex'];
}
$slicedItems = array_slice($items, $upnpRequest['startingindex'], $upnpRequest['requestedcount']);
$domDIDL = Upnp_Api::createDIDL($slicedItems);
$numRet = count($slicedItems);