fix possible error in memcached view

This commit is contained in:
Tanguy Pruvot 2015-07-24 04:50:14 +02:00
parent bfee989e06
commit 2484e4bbc7
2 changed files with 4 additions and 1 deletions

View file

@ -11,7 +11,8 @@
<?php <?php
$coin = getdbo('db_coins', getiparam('id')); $id = getiparam('id');
$coin = getdbo('db_coins', $id);
if (!$coin) { if (!$coin) {
$this->goback(); $this->goback();
} }

View file

@ -12,6 +12,7 @@ function cmp($a, $b)
return $a[2] < $b[2]; return $a[2] < $b[2];
} }
if (!empty($a))
foreach($a as $url=>$n) foreach($a as $url=>$n)
{ {
$d = memcache_get($this->memcache->memcache, "$url-time"); $d = memcache_get($this->memcache->memcache, "$url-time");
@ -32,6 +33,7 @@ echo "<th align=right>Average</th>";
echo "</tr>"; echo "</tr>";
echo "</thead><tbody>"; echo "</thead><tbody>";
if (!empty($res))
foreach($res as $item) foreach($res as $item)
{ {
// debuglog("$i => $n"); // debuglog("$i => $n");