git.cweiske.de
/
stouyapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Do not crash when only few games exist
[stouyapi.git]
/
bin
/
filters.php
diff --git
a/bin/filters.php
b/bin/filters.php
index a10777a03ed65bcec36ed507da65c6dc93a30e2b..107714d7ca5d5afbfe73354771225aea4b12f3e3 100644
(file)
--- a/
bin/filters.php
+++ b/
bin/filters.php
@@
-117,7
+117,7
@@
function filterMostDownloaded($origGames, $limit)
function filterRandom($origGames, $limit)
{
- $randKeys = array_rand($origGames,
$limit
);
+ $randKeys = array_rand($origGames,
min(count($origGames), $limit)
);
$games = [];
foreach ($randKeys as $key) {
$games[] = $origGames[$key];