Skip to content

Commit

Permalink
check if value is defined as 0 is also a false value, but we want to …
Browse files Browse the repository at this point in the history
…keep it.
  • Loading branch information
lukasmueller committed Feb 15, 2025
1 parent 616a858 commit 16da8d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/CXGN/File/Parse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ be treated as management factors / treatments.
use Moose;
use Try::Tiny;
use Module::Pluggable require => 1;
use Data::Dumper;

# Path to the file that is being parsed
has 'file' => (
Expand Down Expand Up @@ -391,7 +392,7 @@ sub parse {
foreach my $d (@$data) {
foreach my $c ( @{$parsed->{required_columns}} ) {
my $v = $d->{$c};
if ( !$v || $v eq '' ) {
if ( !defined($v) || $v eq '' ) {
my $r = $d->{_row};
push @{$parsed->{errors}}, "Required column $c does not have a value in row $r";
}
Expand Down Expand Up @@ -463,7 +464,7 @@ sub clean_value {
my $column_arrays = $self->column_arrays();

# trim whitespace
if ( $value && $value ne '' ) {
if ( defined($value) && $value ne '' ) {
$value =~ s/^\s+|\s+$//g;
}

Expand Down

0 comments on commit 16da8d9

Please sign in to comment.