mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-01 10:47:37 +08:00
NPE in Task Handler Impl #PL-7371
This commit is contained in:
parent
0c8e21c3f8
commit
eb220fd79b
@ -20,6 +20,7 @@ package com.haulmont.cuba.gui.executors;
|
||||
import com.haulmont.cuba.gui.components.Frame;
|
||||
import com.haulmont.cuba.gui.components.Window;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -178,6 +179,7 @@ public abstract class BackgroundTask<T, V> {
|
||||
/**
|
||||
* @return owner window
|
||||
*/
|
||||
@Nullable
|
||||
public final Frame getOwnerFrame() {
|
||||
return ownerFrame;
|
||||
}
|
||||
|
@ -122,9 +122,11 @@ public class TaskHandlerImpl<T, V> implements BackgroundTaskHandler<V> {
|
||||
|
||||
if (log.isTraceEnabled()) {
|
||||
Frame ownerFrame = getTask().getOwnerFrame();
|
||||
String windowClass = ownerFrame.getClass().getCanonicalName();
|
||||
if (ownerFrame != null) {
|
||||
String windowClass = ownerFrame.getClass().getCanonicalName();
|
||||
|
||||
log.trace("Task was cancelled. Task: {}. User: {}. Frame: {}", taskExecutor.getTask(), getUserSession().getId(), windowClass);
|
||||
log.trace("Task was cancelled. Task: {}. User: {}. Frame: {}", taskExecutor.getTask(), getUserSession().getId(), windowClass);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log.trace("Task wasn't cancelled. Execution is already cancelled. Task: {}", taskExecutor.getTask());
|
||||
|
Loading…
Reference in New Issue
Block a user