diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index dff84e823..d71dab107 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -7,6 +7,7 @@ test collateral directory. The method is called getTestCollateralPath. Existing tests using that directory have been modified to use the new method instead of finding the path manually. + - fix: Avatar in Thread & Posts of CS 7.3.1 - Fixed a problem with IE and resizable text areas that caused IE to crash diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 64b23c052..5e6a8fd75 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -317,14 +317,14 @@ Returns a URL to the owner's avatar. sub getAvatarUrl { my $self = shift; - my $avatarUrl; my $parent = $self->getThread->getParent; - return undef unless $parent; - return $avatarUrl unless $parent->getValue("avatarsEnabled"); + return '' unless $parent and $parent->getValue("avatarsEnabled"); my $user = WebGUI::User->new($self->session, $self->get('ownerUserId')); #Get avatar field, storage Id. my $storageId = $user->profileField("avatar"); + return '' unless $storageId; my $avatar = WebGUI::Storage::Image->get($self->session,$storageId); + my $avatarUrl = ''; if ($avatar) { #Get url from storage object. foreach my $imageName (@{$avatar->getFiles}) {