Error by lookup update

Error by lookup update

In field actions Customer_Name On User input I have:

if(Factory[Customer_Name == input.Customer_Name].count()  ==  0)
{
clear Factory_Name;
}
else
{
factoryList = Factory[Customer_Name == input.Customer_Name];
Factory_Name:ui.add(factoryList.Name.getall());
}

When I start it, I get follow error message: Error executing  GENERATEJS_TASK  task (in else block)