From d959afebe17224f80e4d0ac2da74ec80fb953427 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Oct 2015 12:37:56 +0200 Subject: [PATCH] Store unset descriptions etc. as nulls --- src/lib/Hydra/Helper/AddBuilds.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 773b850d..ae93e243 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -429,13 +429,18 @@ sub checkBuild { my $time = time(); + sub null { + my ($s) = @_; + return $s eq "" ? undef : $s; + } + # Add the build to the database. $build = $job->builds->create( { timestamp => $time - , description => $buildInfo->{description} - , license => $buildInfo->{license} - , homepage => $buildInfo->{homepage} - , maintainers => $buildInfo->{maintainers} + , description => null($buildInfo->{description}) + , license => null($buildInfo->{license}) + , homepage => null($buildInfo->{homepage}) + , maintainers => null($buildInfo->{maintainers}) , maxsilent => $buildInfo->{maxSilent} , timeout => $buildInfo->{timeout} , nixname => $buildInfo->{nixName}