From 30a0cda34214e25d2dc103a15c65916e4eb39232 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Tue, 30 Jan 2007 16:09:41 +0000 Subject: [PATCH] fix - lack of testing for valid object creation --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/AssetLineage.pm | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index a1b452448..7c8defd7c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -8,6 +8,7 @@ - fix: Exporting fails with strange URLs. Also factored the URL to path/file translation out into a seperate method so it can be more easily maintained and tested. + - fix: lack of testing for valid object creation 7.3.8 - Fixed a template variable rewriting problem with HTML::Template::Expr diff --git a/lib/WebGUI/AssetLineage.pm b/lib/WebGUI/AssetLineage.pm index 6d53d725a..23647020d 100644 --- a/lib/WebGUI/AssetLineage.pm +++ b/lib/WebGUI/AssetLineage.pm @@ -450,6 +450,10 @@ sub getLineage { $asset = $self; } else { $asset = WebGUI::Asset->new($self->session,$id, $class, $version); + if (!defined $asset) { # won't catch everything, but it will help some if an asset blows up + $self->session->errorHandler->error("AssetLineage::getLineage - failed to instanciate asset with assetId $id, className $class, and revision $version"); + next; + } } } else { $asset = $id;