Skip to content

Commit 599bfb9

Browse files
committed
removed dependence of EmailTransform on httpcontext
1 parent 40f6b20 commit 599bfb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/Helpers/ApiHelper_Utilities.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ public static string EmailTransform(string template, BaseModel model,NotifyActio
257257
string editUrl = "";
258258
try {
259259
var hcontext = HttpContext.Current;
260-
user = hcontext.User.Identity.Name;
261-
var uri = hcontext.Request.GetUri();
260+
user = hcontext?.User?.Identity?.Name??"";
261+
var uri = hcontext?.Request?.GetUri() ?? PuckCache.FirstRequestUrl;
262262
editUrl = uri.Scheme +"://"
263263
+ uri.Host
264264
+ (uri.Port!=80 ?(":" + uri.Port):"")

0 commit comments

Comments
 (0)