From: Ian Campbell Date: Tue, 2 Jul 2013 10:03:46 +0000 (+0100) Subject: Emesinae::Message: Die in lookup_id if id doesn't exist. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=11bd462cd2e1a39790375ee7417a5f5c7f6c20e0;p=people%2Faperard%2Femesinae.git Emesinae::Message: Die in lookup_id if id doesn't exist. --- diff --git a/Emesinae/Message.pm b/Emesinae/Message.pm index f445bb8..5103d06 100644 --- a/Emesinae/Message.pm +++ b/Emesinae/Message.pm @@ -24,8 +24,12 @@ sub lookup_id { $sth->execute($id); + my $row = $sth->fetch; + + die "lookup_id $id" unless defined $row; + my ( $msgid, $present, $inserted, $msgtype, $date, $from, $to, $cc, $subj ) - = @{ $sth->fetch }; + = @{$row}; $sth->finish;