mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-23 02:24:25 +01:00
MessageHistory: get_ancestor_id: ensure id has a valid value
This commit is contained in:
parent
516e093a20
commit
f9a50f0d27
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user