try to localize strange error

This commit is contained in:
Glen Whitney 2017-10-25 16:40:56 +02:00
parent ab35761b24
commit 1662da4e75
1 changed files with 5 additions and 4 deletions

View File

@ -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;