3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-02 10:09:32 +01:00

Fix factundo on deleted factoids

This commit is contained in:
Pragmatic Software 2017-10-04 17:56:16 -07:00
parent 0ab6a46008
commit 652cad7ddf

View File

@ -314,11 +314,8 @@ sub factundo {
} }
} }
if ($undos->{idx} == 0) {
return "There are no more undos remaining for [$channel] $trigger.";
}
unless ($deleted) { unless ($deleted) {
return "There are no more undos remaining for [$channel] $trigger." if not $undos->{idx};
$undos->{idx}--; $undos->{idx}--;
eval { store $undos, "$path/$trigger_safe.$channel_path_safe.undo"; }; eval { store $undos, "$path/$trigger_safe.$channel_path_safe.undo"; };
$self->{pbot}->{logger}->log("Error storing undo: $@\n") if $@; $self->{pbot}->{logger}->log("Error storing undo: $@\n") if $@;