]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
aspell_complete: Fix crash when the dictionary is unset
authorAilin Nemui <redacted>
Fri, 29 Jan 2016 11:59:40 +0000 (08:59 -0300)
committerdequis <redacted>
Fri, 29 Jan 2016 13:44:31 +0000 (10:44 -0300)
This will be fixed on the irssi side too.

scripts/aspell_complete.pl

index da8d08c198a8ee384be76c4230e7bf04ef8c0285..93b214524f1499fbb409fd88f97acf80fe9c3e28 100644 (file)
@@ -18,7 +18,7 @@ use vars qw($VERSION %IRSSI);
 use Irssi;
 use Text::Aspell;
 
-$VERSION = '1.00';
+$VERSION = '1.01';
 %IRSSI = (
   authors     => 'Philipp Haegi',
   contact     => 'phaegi\@mimir.ch',
@@ -59,7 +59,7 @@ sub rotate_dict() {
 
 Irssi::signal_add_last 'complete word' => sub {
   my ($complist, $window, $word, $linestart, $want_space) = @_;
-  push(@$complist, $speller->suggest( $word ));
+  push(@$complist, grep { defined } $speller->suggest( $word )); # eliminate null pointers
 };
 
 
git clone https://git.99rst.org/PROJECT