Properly handle if the related board cannot be found in mappers

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-11-13 12:03:05 +01:00
parent 4549a2b0ee
commit 2de43a6725
4 changed files with 27 additions and 8 deletions

View File

@@ -322,8 +322,7 @@ class CardMapper extends QBMapper implements IPermissionMapper {
$stmt = $this->db->prepare($sql);
$stmt->bindParam(1, $cardId, \PDO::PARAM_INT);
$stmt->execute();
$row = $stmt->fetch();
return $row['id'];
return $stmt->fetchColumn() ?? null;
}
public function mapOwner(Card &$card) {