We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b455c2cc authored by jurgbohn's avatar jurgbohn

Check for PEAR::isError before we decide to output stuff to user

parent fab097e9
...@@ -77,7 +77,7 @@ class Album { ...@@ -77,7 +77,7 @@ class Album {
$res = $mdb2->query("SELECT COUNT(*) AS scrobbles FROM Scrobbles JOIN Track ON Scrobbles.track = Track.name WHERE Scrobbles.artist = " $res = $mdb2->query("SELECT COUNT(*) AS scrobbles FROM Scrobbles JOIN Track ON Scrobbles.track = Track.name WHERE Scrobbles.artist = "
. $mdb2->quote($this->artist_name, 'text') . 'AND Track.album =' . $mdb2->quote($this->artist_name, 'text') . 'AND Track.album ='
. $mdb2->quote($this->name, 'text')); . $mdb2->quote($this->name, 'text'));
if(!$res->numRows()) { if(PEAR::isError($res) || !$res->numRows()) {
$c = 0; $c = 0;
} else { } else {
$row = sanitize($res->fetchRow(MDB2_FETCHMODE_ASSOC)); $row = sanitize($res->fetchRow(MDB2_FETCHMODE_ASSOC));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment