summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2006-10-12 09:42:27 +0000
committerivan <ivan>2006-10-12 09:42:27 +0000
commit3abe5fc066a9bc7fd7ee5ba227270179ba569116 (patch)
tree4fd6f6fcaf3efd9128103d281f421e58286347ff
parent62de97c26bc4daebce329af68e6e910474ced6c2 (diff)
fix "amatch: $_ is undefined: what are you matching" error when there are no companies in the fuzzy cache yet
-rw-r--r--FS/FS/cust_main.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 95ed7defb..3942acf01 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -3969,12 +3969,12 @@ sub fuzzy_search {
check_and_rebuild_fuzzyfiles();
foreach my $field ( keys %$fuzzy ) {
+
+ my $all = $self->all_X($field);
+ next unless scalar(@$all);
+
my %match = ();
- $match{$_}=1 foreach ( amatch( $fuzzy->{$field},
- ['i'],
- @{ $self->all_X($field) }
- )
- );
+ $match{$_}=1 foreach ( amatch( $fuzzy->{$field}, ['i'], @$all ) );
my @fcust = ();
foreach ( keys %match ) {