[tools] testbot/web: Fix the $Task->TestFailures check.

Francois Gouget fgouget at codeweavers.com
Wed Feb 10 09:36:17 CST 2021


If it has not been set to a numeric value, $Task->TestFailures is
undefined so comparing it to an empty string makes no sense.
Fortunately undef ne "" is false (as well as undef eq "") so the code was
doing the right thing and was not generating a warning since warnings
are not turned on.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/web/index.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index 088aea111..248622955 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -131,7 +131,7 @@ sub GenerateDataCell($$$$)
         foreach my $Task (@{$Step->Tasks->GetItems()})
         {
           my $TaskFailures = $Task->TestFailures;
-          if ($TaskFailures ne "")
+          if (defined $TaskFailures)
           {
             $HasTestResult = 1;
             $Failures += $TaskFailures;
-- 
2.20.1



More information about the wine-devel mailing list