From 33a32d4409d5656c414fb7abb9d5c84f224bdc89 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 5 Jan 2018 19:45:28 -0800 Subject: [PATCH] g.pl: show no results for vs mode as well --- modules/g.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/g.pl b/modules/g.pl index 511dd070..baa83c63 100755 --- a/modules/g.pl +++ b/modules/g.pl @@ -38,12 +38,12 @@ if ($arguments =~ m/(.*)\svs\s(.*)/i) { my $result1 = $engine->search($a); my $result2 = $engine->search($b); - if (not @{$result1->items}) { + if (not defined $result1 or not defined $result1->items or not @{$result1->items}) { print "No results for $a\n"; exit; } - if (not @{$result2->items}) { + if (not defined $result2 or not defined $result2->items or not @{$result2->items}) { print "No results for $b\n"; exit; }