diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b4ac56888..84ab929f8 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -8,6 +8,7 @@ http://www.plainblack.com/bugs/tracker/trouble-with-search-users - fix: Fixed an unhandled exception in Workflow/Activity/PurgeOldAssetRevisions.pm - Added better error handling for asset instanciation in version tags. + - Added better error handling in asset instanciation. - fix: Image::Magick->Scale does nothing if given dimensions < 1, so make sure they are large enough when generating thumbnails in Storage/Image.pm diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index a0ad7fdb8..a1cb251e1 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -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) {