mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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 <lfleischer@archlinux.org>
This commit is contained in:
parent
102dad49e7
commit
5553d01ab3
1 changed files with 3 additions and 4 deletions
|
@ -852,12 +852,11 @@ function pkgbase_user_notify($uid, $base_id) {
|
||||||
$q.= " AND PackageBaseID = " . $dbh->quote($base_id);
|
$q.= " AND PackageBaseID = " . $dbh->quote($base_id);
|
||||||
$result = $dbh->query($q);
|
$result = $dbh->query($q);
|
||||||
|
|
||||||
if ($result->fetch(PDO::FETCH_NUM)) {
|
if (!$result) {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ($result->fetch(PDO::FETCH_NUM) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue