3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

MessageHistory: get_ancestor_id: ensure id has a valid value

This commit is contained in:
Pragmatic Software 2019-05-09 18:04:15 -07:00
parent 516e093a20
commit f9a50f0d27

View File

@ -1731,6 +1731,8 @@ sub get_also_known_as {
sub get_ancestor_id {
my ($self, $id) = @_;
$id = 0 if not defined $id;
my $ancestor = eval {
my $sth = $self->{dbh}->prepare('SELECT id FROM Aliases WHERE alias = ? ORDER BY id LIMIT 1');
$sth->execute($id);