Skip to content

Commit 7b9f243

Browse files
committed
check null to stop test failing
1 parent 927494c commit 7b9f243

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Confab/Services/UserService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public async Task<LoginResponse> Login(UserLogin userLogin, HttpContext httpCont
244244

245245
UserSchema anonUser = null;
246246
try{
247-
anonUser = await GetUserFromJWT(httpContext, dbCtx); // decode JWT, get anon user (if sent)
247+
if (httpContext != null) anonUser = await GetUserFromJWT(httpContext, dbCtx); // decode JWT, get anon user (if sent)
248248
} catch (MissingAuthorizationException) {} //if no JWT, don't assign anonUser
249249

250250
if (user == null) //if user doesn't exist, can't login

0 commit comments

Comments
 (0)