Commit 5553d01a authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Check query return value in pkgbase_user_notify()



Instead of unconditionally calling fetch on the return value of query(),
error out early if the value evaluates to false.
Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
parent 102dad49
......@@ -852,12 +852,11 @@ function pkgbase_user_notify($uid, $base_id) {
$q.= " AND PackageBaseID = " . $dbh->quote($base_id);
$result = $dbh->query($q);
if ($result->fetch(PDO::FETCH_NUM)) {
return true;
}
else {
if (!$result) {
return false;
}
return ($result->fetch(PDO::FETCH_NUM) > 0);
}
/**
......
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