Check for lack of existence of an asset before logging an error. Fixes bug #11526

This commit is contained in:
Colin Kuskie 2010-04-19 08:21:19 -07:00
parent ea5e82b626
commit c8414bee52
2 changed files with 7 additions and 3 deletions

View file

@ -9,6 +9,7 @@
- added #10945: Wiki - Top-level keyword list
- fixed #11444: Strange spectre problem
- fixed #10189: pbworkflow000000000007 Hanging
- fixed #11526: Wrong log error in file AssetClipboard.pm
7.9.2
- added: Workflow to extend recurring Calendar events 2 years from the

View file

@ -98,9 +98,12 @@ sub duplicate {
my $newAsset
= $parent->addChild( $self->get, undef, $self->get("revisionDate"), { skipAutoCommitWorkflows => $options->{skipAutoCommitWorkflows} } );
$self->session->log->error(
sprintf "Unable to add child %s (%s) to %s (%s)", $self->getTitle, $self->getId, $parent->getTitle, $parent->getId
);
if (! $newAsset) {
$self->session->log->error(
sprintf "Unable to add child %s (%s) to %s (%s)", $self->getTitle, $self->getId, $parent->getTitle, $parent->getId
);
return undef;
}
# Duplicate metadata fields
my $sth = $self->session->db->read(
"select * from metaData_values where assetId = ?",