Skip to content

Commit 5f9ac65

Browse files
committed
Better to use FlowExecutionOwner.getRootDir.
1 parent 4f0bc3b commit 5f9ac65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/jenkinsci/plugins/workflow/log/LogStorage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ public interface LogStorage {
125125
default @Nonnull File getLogFile(@Nonnull FlowExecutionOwner.Executable build, boolean complete) {
126126
try {
127127
AnnotatedLargeText<FlowExecutionOwner.Executable> logText = overallLog(build, complete);
128-
File f = File.createTempFile("deprecated", ".log", build instanceof Run ? ((Run) build).getRootDir() : null);
128+
FlowExecutionOwner owner = build.asFlowExecutionOwner();
129+
File f = File.createTempFile("deprecated", ".log", owner != null ? owner.getRootDir() : null);
129130
f.deleteOnExit();
130131
try (OutputStream os = new FileOutputStream(f)) {
131132
// Similar to Run#writeWholeLogTo but terminates even if !complete:

0 commit comments

Comments
 (0)