From 2e55db01a7c8990957256d959911312eadc33255 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 12 Feb 2018 16:54:35 -0800 Subject: [PATCH] don't barf displaying invoices for location-less customers, RT#79312 --- FS/FS/Template_Mixin.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index b9f3e9274..88fd4e87f 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -657,10 +657,11 @@ sub print_generic { $invoice_data{'cid'} = $params{'cid'} if $params{'cid'}; - if ( $cust_main->country eq $countrydefault ) { - $invoice_data{'country'} = ''; - } else { + if ( $cust_main->bill_locationnum + && $cust_main->bill_location->country ne $countrydefault ) { $invoice_data{'country'} = &$escape_function($cust_main->bill_country_full); + } else { + $invoice_data{'country'} = ''; } my @address = (); -- 2.11.0