Skip to content

Commit

Permalink
DC reactor: Fix cases of '0' being treated as undef
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfsage committed Sep 22, 2021
1 parent a514aab commit 42bea9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Synergy/Reactor/DC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sub handle_dc($self, $event) {
}

my ($cmd) = $event->text =~ /^dc\s+(?:-e\s+)?'?(.*?)'?\s*$/i;
unless ($cmd) {
unless (length ($cmd // '')) {
return $event->reply("Sory, I didn't understand that. Try: dc -e '1 2 +p', for example");
}

Expand Down Expand Up @@ -86,7 +86,7 @@ sub handle_dc($self, $event) {
$event->reply("Sorry, dc terminated on signal $exitcode");

return;
} elsif (! $resp) {
} elsif (! length($resp // '' )) {
$event->reply("<no output>");

return;
Expand Down

0 comments on commit 42bea9d

Please sign in to comment.