From db34c349b46cb25759696b9597ebbf894e85845a Mon Sep 17 00:00:00 2001 From: Aleksi Simell Date: Fri, 23 Feb 2024 06:36:01 +0200 Subject: [PATCH] Fix checking if file exists (#67) --- src/main/java/hudson/plugins/robot/RobotPublisher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/hudson/plugins/robot/RobotPublisher.java b/src/main/java/hudson/plugins/robot/RobotPublisher.java index f35c426..a819989 100755 --- a/src/main/java/hudson/plugins/robot/RobotPublisher.java +++ b/src/main/java/hudson/plugins/robot/RobotPublisher.java @@ -270,10 +270,10 @@ public void perform(Run build, @Nonnull FilePath workspace, @Nonnull EnvVa // Check if log and report files exist FilePath outputDir = new FilePath(workspace, expandedOutputPath); - if (!new FilePath(outputDir, expandedLogFileName).exists()) { + if (outputDir.list(expandedLogFileName).length == 0) { logger.println(Messages.robot_publisher_file_not_found() + " " + expandedLogFileName); } - if (!new FilePath(outputDir, expandedReportFileName).exists()) { + if (outputDir.list(expandedReportFileName).length == 0) { logger.println(Messages.robot_publisher_file_not_found() + " " + expandedReportFileName); }