Fix Contact selection on prospect, from Fernando-Kiernan, github#54
authorIvan Kohler <ivan@freeside.biz>
Thu, 18 Aug 2016 21:01:58 +0000 (14:01 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 18 Aug 2016 21:01:58 +0000 (14:01 -0700)
FS/FS/prospect_main.pm

index 9472996..67e91cf 100644 (file)
@@ -270,8 +270,11 @@ sub name {
   my $self = shift;
   return $self->company if $self->company;
 
-  my $contact = ($self->prospect_contact)[0]->contact; #first contact?  good enough for now
-  return $contact->line if $contact;
+  my $prospect_contact = ($self->prospect_contact)[0]; #first contact?  good enough for now
+  my $contact = $prospect_contact->contact if $prospect_contact;
+  return $contact->line if $prospect_contact && $contact;
+
+  #address?
 
   'Prospect #'. $self->prospectnum;
 }