Fix factundo on deleted factoids

This commit is contained in:
Pragmatic Software 2017-10-04 17:56:16 -07:00
parent 0ab6a46008
commit 652cad7ddf
1 changed files with 1 additions and 4 deletions

View File

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