Skip to content

Commit

Permalink
fix undefined warning in DW/Controller/API/Media.pm
Browse files Browse the repository at this point in the history
Use of uninitialized value $type in numeric eq (==) at /home/dw/production/cgi-bin/DW/Controller/API/Media.pm line 74.
  • Loading branch information
kareila committed Feb 16, 2017
1 parent ae9ef2c commit 850cf4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cgi-bin/DW/Controller/API/Media.pm
Expand Up @@ -71,7 +71,7 @@ sub file_new_handler {

foreach my $upload ( @$uploads ) {
my ( $type, $ext ) = DW::Media->get_upload_type( $upload->{'content-type' } );
next unless $type == DW::Media::TYPE_PHOTO;
next unless defined $type && $type == DW::Media::TYPE_PHOTO;

# Try to upload this item since we know it's a photo.
my $obj = DW::Media->upload_media(
Expand Down

0 comments on commit 850cf4c

Please sign in to comment.