Fixes the latest merge

This commit is contained in:
Paul Schneider 2015-10-20 18:38:50 +02:00
commit 777f4fb4c2
32 changed files with 108 additions and 110 deletions

View file

@ -158,15 +158,15 @@ namespace Yavsc.Helpers
/// <param name="helper">Helper.</param>
/// <param name="username">Username.</param>
public static string AvatarUrl (this System.Web.Mvc.UrlHelper helper, string username) {
if (username == null)
return null;
if (username == null) return null;
ProfileBase pr = ProfileBase.Create (username);
object avpath = null;
if (pr != null) avpath = pr.GetPropertyValue("Avatar");
if (avpath == null) return DefaultAvatar==null?"/bfiles/"+username+".png":DefaultAvatar;
if (avpath == null || avpath is DBNull)
return DefaultAvatar==null?"/bfiles/"+username+".png":DefaultAvatar;
string avatarLocation = avpath as string;
if (avatarLocation.StartsWith ("~/")) {
avatarLocation = helper.RequestContext.HttpContext.Server.MapPath(avatarLocation);
avatarLocation = helper.RouteUrl("Default", avatarLocation);
}
return avatarLocation;