diff -r d620048b4810 -r dcf0eedfc1a3 emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp --- a/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Thu Jul 15 18:19:25 2010 +0300 +++ b/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Thu Aug 19 09:38:05 2010 +0300 @@ -47,6 +47,8 @@ _LIT( KUrlFormat, "%S" ); _LIT( KUrlFormatWithHttp, "%S" ); +_LIT( KEmpty, "" ); + // Define this to allow theme colorin for the header #define __USE_THEME_COLOR_FOR_HEADER @@ -251,11 +253,21 @@ _LIT( KCollapseFunction, "collapseHeader(true)" ); _LIT( KSenderFormat, "
%S
\n" ); const CFSMailAddress* sender( iMailMessage.GetSender() ); - TPtrC displayName( sender->GetDisplayName() ); - if ( !displayName.Length() ) + + TPtrC displayName; + if ( sender ) { - displayName.Set( sender->GetEmailAddress() ); + displayName.Set( sender->GetDisplayName() ); + if ( !displayName.Length() ) + { + displayName.Set( sender->GetEmailAddress() ); + } } + else + { + displayName.Set( KEmpty ); + } + const TPtrC function( aCollapsed ? KExpandFunction() : KCollapseFunction() ); const TPtrC style( aCollapsed ? KStyleExpand() : KStyleCollapse() ); const TPtrC align( iExportFlags.IsSet( EMirroredLayout ) ? KAlignRight() : KAlignLeft() ); @@ -271,7 +283,17 @@ { _LIT( KSenderAddressFormat, "
%S
\n" ); const CFSMailAddress* sender( iMailMessage.GetSender() ); - const TPtrC emailAddress( sender->GetEmailAddress() ); + + TPtrC emailAddress; + if ( sender ) + { + emailAddress.Set( sender->GetEmailAddress() ); + } + else + { + emailAddress.Set( KEmpty ); + } + const TPtrC align( iExportFlags.IsSet( EMirroredLayout ) ? KAlignRight() : KAlignLeft() ); HBufC* formatBuffer = HBufC::NewLC( KSenderAddressFormat().Length() + emailAddress.Length() * 2 + align.Length() ); formatBuffer->Des().Format( KSenderAddressFormat(), &align, &emailAddress, &emailAddress );