From 1662da4e75ca41c374707addcd4a2a67357c8b19 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Wed, 25 Oct 2017 16:40:56 +0200 Subject: [PATCH] try to localize strange error --- gap/bytable.gi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gap/bytable.gi b/gap/bytable.gi index 0e1b438..976424e 100644 --- a/gap/bytable.gi +++ b/gap/bytable.gi @@ -406,15 +406,16 @@ InstallOtherMethod(DirectProductOp, "for a list and non-quasigroup magma built form multiplication table", [IsList, IsMagma and IsBuiltFromMultiplicationTable], function (list, first) - local item, i, jof, bigtable; + local n, item, i, jof, bigtable; + n := Length(list); # Simple checks - if IsEmpty(list) then + if n = 0 then Error("Usage: Cannot take DirectProduct of zero items."); - elif Length(list) = 1 then + elif n = 1 then return list[1]; fi; # See if we can handle all objects - for i in [2..Length(list)] do + for i in [2..n] do if not HasMultiplicationTable(list(i)) then return DirectProductOp(Permuted(list, (1,i)), list[i]); fi;