From: Steinar H. Gunderson Date: Tue, 21 Aug 2007 05:18:29 +0000 (+0200) Subject: Treat empty lens/model as NULL. Doesn't actually appear to happen much in X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=0c4613d6b310d6dcd8e0035bc26abce3bbd97a08 Treat empty lens/model as NULL. Doesn't actually appear to happen much in practice. --- diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index eff6fc1..d2dcd7d 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -265,9 +265,11 @@ sub update_image_info { $model =~ s/^\s*//; $model =~ s/\s*$//; + $model = undef if (length($model) == 0); $lens =~ s/^\s*//; $lens =~ s/\s*$//; + $lens = undef if (length($lens) == 0); # Now update the main table with the information we've got $dbh->do('UPDATE images SET width=?, height=?, date=?, model=?, lens=? WHERE id=?',