forward port of getAllInstances fixes, so that it never returns undef but logs warnings instead

This commit is contained in:
Colin Kuskie 2007-06-22 17:55:25 +00:00
parent a640222a29
commit 4de39b7fe5
2 changed files with 9 additions and 1 deletions

View file

@ -166,7 +166,13 @@ sub getAllInstances {
my @instances = ();
my $rs = $session->db->read("SELECT instanceId FROM WorkflowInstance");
while (my ($instanceId) = $rs->array) {
push(@instances, WebGUI::Workflow::Instance->new($session, $instanceId));
my $instance = WebGUI::Workflow::Instance->new($session, $instanceId);
if (defined $instance) {
push(@instances, $instance);
}
else {
$session->errorHandler->warn('Tried to instance instanceId '.$instanceId.' but it returned undef');
}
}
return \@instances;
}