Changeset 2389


Ignore:
Timestamp:
06/08/20 23:07:13 (4 years ago)
Author:
nanardon
Message:

Fix: return undef if attribute does not exists on the form

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm

    r2362 r2389  
    394394    my ($self, $attr) = @_; 
    395395 
    396     $self->{_attr}{$attr}->attr_hint; 
     396    if (my $fattr = $self->{_attr}{$attr}) { 
     397        return $fattr->attr_hint; 
     398    } else { 
     399        return; 
     400    } 
    397401} 
    398402 
     
    400404    my ($self, $attr, $type) = @_; 
    401405 
    402     $self->{_attr}{$attr}->attr_field($type); 
     406    if (my $fattr = $self->{_attr}{$attr}) { 
     407        return $fattr->attr_field($type); 
     408    } else { 
     409        return; 
     410    } 
    403411} 
    404412 
Note: See TracChangeset for help on using the changeset viewer.