Prevent Form/File from returning links in getValueAsHtml if there's

no real value in the storage element to return.
This commit is contained in:
Colin Kuskie 2009-06-03 21:08:40 +00:00
parent cdedf8c6b5
commit 472580dd45
2 changed files with 2 additions and 0 deletions

View file

@ -222,6 +222,7 @@ sub getValueAsHtml {
return '' unless $value;
my $location = WebGUI::Storage->get($self->session,$value);
my $file = shift @{ $location->getFiles };
return '' unless $file;
my $fileValue = sprintf qq|<img src="%s" />&nbsp;<a href="%s">%s</a>|, $location->getFileIconUrl($file), $location->getUrl($file), $file;
return $fileValue;
}