Added better error handling in asset instanciation.

This commit is contained in:
JT Smith 2007-04-19 03:36:50 +00:00
parent 886d8215b8
commit 1c4f84ab13
2 changed files with 5 additions and 1 deletions

View file

@ -1510,7 +1510,10 @@ sub new {
$where .= " and (asset.assetId=".$definition->{tableName}.".assetId and ".$definition->{tableName}.".revisionDate=".$revisionDate.")";
}
$properties = $session->db->quickHashRef($sql.$where);
return undef unless (exists $properties->{assetId});
unless (exists $properties->{assetId}) {
$session->errorHandler->error("Asset $assetId $class $revisionDate is missing properties. Consult your database tables for corruption. ");
return undef;
}
$cache->set($properties,60*60*24);
}
if (defined $properties) {