Delay getting CurrentUser in RequestScopePropagator
If the Callable doesn't ask for the CurrentUser, avoid getting it from the supplied RequestContext. This works around contexts that have no CurrnetUser and throw from getCurrentUser() if invoked. Change-Id: I4d1ccbc77b29589d7553a0e296687dca4bb2af7a
This commit is contained in:
@@ -175,11 +175,10 @@ public abstract class RequestScopePropagator {
|
||||
return new Callable<T>() {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
final CurrentUser user = context.getCurrentUser();
|
||||
RequestContext old = local.setContext(new RequestContext() {
|
||||
@Override
|
||||
public CurrentUser getCurrentUser() {
|
||||
return user;
|
||||
return context.getCurrentUser();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user