From: bw1 Date: Thu, 6 Jan 2022 16:24:38 +0000 (+0100) Subject: [leodict] change error handling and update s chec X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=0da8f6e61fb0d51aad24b162bb894f2fd770b5a7;p=irssi-scripts.irssi.org.git [leodict] change error handling and update s chec --- diff --git a/scripts/leodict.pl b/scripts/leodict.pl index f440cb3..8b1fd8a 100644 --- a/scripts/leodict.pl +++ b/scripts/leodict.pl @@ -117,7 +117,10 @@ sub parser { %fresult=(); # tables - return unless (defined $ftext); + unless (defined $ftext) { + %fresult=('Error'=>[['no data']]); + return; + } my $dom = Mojo::DOM->new($ftext); foreach my $tbl ( $dom->find('table')->each ) { @@ -401,8 +404,8 @@ sub self_check { $s="Error: results ($count)"; } Irssi::print("selfcheck: $s"); - my $schs_version = $Irssi::Script::selfcheckhelperscript::VERSION; - Irssi::command("selfcheckhelperscript $s") if ( defined $schs_version ); + my $schs = exists $Irssi::Script::{'selfcheckhelperscript::'}; + Irssi::command("selfcheckhelperscript $s") if ( $schs ); } sub sig_setup_changed {