From 0f863df717cfc7b121a82d263c5cf342a8082c8c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 22 Feb 2021 21:40:24 +0100 Subject: [PATCH] Don't freak out if a package has an empty or short Date I've had a package prototype sitting around with an empty Date field. While of course the validator rejects that, the package loading code should not, or at least should not run into a break loop. --- lib/package.gi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/package.gi b/lib/package.gi index 1ded9f87af..e5b2c7a9c5 100644 --- a/lib/package.gi +++ b/lib/package.gi @@ -246,7 +246,7 @@ BindGlobal( "AddPackageInfos", function( files, pkgdir, ignore ) # then we change it to dd/mm/yyyy. When other tools have adapted to # the yyyy-mm-dd format we can normalize to that format and at some # point in the future get rid of this code. - if record.Date{[5,8]} = "--" then + if Length(record.Date) = 10 and record.Date{[5,8]} = "--" then date := List( SplitString( record.Date, "-" ), Int); date := Permuted(date, (1,3)); # date = [dd,mm,yyyy] # generate the day and month strings