Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8f3e8a02

Von Moritz Bunkus vor etwa 9 Jahren hinzugefügt

  • ID 8f3e8a0254bc848d02958cc5e1fcdf600d5632a8
  • Vorgänger 34ea9b39
  • Nachfolger 22744c20

Benutzung undefinierter Werte vermeiden

Unterschiede anzeigen:

SL/Auth.pm
1120 1120
      push @{$cur_ary}, $token;
1121 1121

  
1122 1122
    } else {
1123
      push @{$cur_ary}, $self->{RIGHTS}->{$login}->{$token} * 1;
1123
      push @{$cur_ary}, ($self->{RIGHTS}->{$login}->{$token} // 0) * 1;
1124 1124
    }
1125 1125
  }
1126 1126

  
SL/DATEV.pm
263 263
  my $fill_char = shift;
264 264
  my $alignment = shift || 'right';
265 265

  
266
  my $text_len  = length $text;
266
  my $text_len  = length($text // '');
267 267

  
268 268
  if ($field_len < $text_len) {
269 269
    $text = substr $text, 0, $field_len;
SL/DBUtils.pm
222 222
  my %hash;
223 223
  if ('' eq ref $value_col) {
224 224
    while (my $ref = $sth->fetchrow_hashref()) {
225
      $hash{$ref->{$key_col}} = $ref->{$value_col};
225
      $hash{$ref->{$key_col} // ''} = $ref->{$value_col};
226 226
    }
227 227
  } else {
228 228
    while (my $ref = $sth->fetchrow_hashref()) {
229
      $hash{$ref->{$key_col}} = { map { $_ => $ref->{$_} } @{ $value_col } };
229
      $hash{$ref->{$key_col} // ''} = { map { $_ => $ref->{$_} } @{ $value_col } };
230 230
    }
231 231
  }
232 232

  
SL/Menu.pm
103 103
  my %by_parent;
104 104
  # order them by parent
105 105
  for my $node ($self->nodes) {
106
    push @{ $by_parent{ $node->{parent} } //= [] }, $node;
106
    push @{ $by_parent{ $node->{parent} // '' } //= [] }, $node;
107 107
  }
108 108

  
109 109
  my $tree = { };
sql/Pg-upgrade2/defaults_datev_check.pl
22 22
  # kivitendo's behaviour isn't changed by this update
23 23
  # if checks are not set in config set it to true
24 24
  foreach my $check (qw(check_on_sales_invoice check_on_purchase_invoice check_on_ar_transaction check_on_ap_transaction check_on_gl_transaction)) {
25
    my $check_set = 1;
26
    if ($::lx_office_conf{datev_check}->{$check} == 0 && defined ($::lx_office_conf{datev_check}->{$check})) {
27
      $check_set = 0;
28
    }
29

  
25
    my $check_set     = defined($::lx_office_conf{datev_check}->{$check}) && ($::lx_office_conf{datev_check}->{$check} == 0) ? 0 : 1;
30 26
    my $update_column = "UPDATE defaults SET datev_$check = '$check_set';";
31 27
    $self->db_query($update_column);
32 28
  }

Auch abrufbar als: Unified diff