Skip to content

Commit 65b0b61

Browse files
committed
fix so that we check to see if the site.master exists and if not we just roll back to a standard one. This can happen when the site us using a custom theme then the theme is removed. In the previous implementation this resulted in a blank page getting rendered. The error handling didn't seem to work
1 parent 94feed5 commit 65b0b61

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

BlogEngine/BlogEngine.Core/Web/Controls/BlogBasePage.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,14 @@ string GetSiteMaster()
279279
return path;
280280
}
281281

282-
return string.Format("{0}Custom/Themes/{1}/site.master", Utils.ApplicationRelativeWebRoot,
283-
BlogSettings.Instance.GetThemeWithAdjustments(null));
282+
var siteMaster = string.Format("{0}Custom/Themes/{1}/site.master", Utils.ApplicationRelativeWebRoot,
283+
BlogSettings.Instance.GetThemeWithAdjustments(null));
284+
285+
if (System.IO.File.Exists(Server.MapPath(siteMaster)))
286+
return siteMaster;
287+
else
288+
return string.Format("{0}Custom/Themes/Standard/site.master", Utils.ApplicationRelativeWebRoot);
289+
284290
}
285291
}
286292
}

0 commit comments

Comments
 (0)