Fixed NodeFactory enum check

This commit is contained in:
Daniel Poustka 2020-12-26 15:46:57 +01:00
parent 853bf05ee5
commit faffec4f1c

View File

@ -59,18 +59,20 @@ public class NodeFactory
case Customer: case Customer:
n = new Customer(startMoney); n = new Customer(startMoney);
break; break;
default:
} }
String[] subs = subsChannels.split(";"); if (n != null)
for (String s : subs)
{ {
String[] el = s.split(" "); String[] subs = subsChannels.split(";");
for (String s : subs)
{
String[] el = s.split(" ");
ChannelPool temp = FoodChain.getFactoryManager().getPoolDatabaseInstance().getChannelPoolInstance(); ChannelPool temp = FoodChain.getFactoryManager().getPoolDatabaseInstance().getChannelPoolInstance();
n.subscribeToChannel(temp.findByType(ProductType.valueOf(el[0])), ChannelSubscriptionType.valueOf(el[1])); n.subscribeToChannel(temp.findByType(ProductType.valueOf(el[0])), ChannelSubscriptionType.valueOf(el[1]));
}
} }
return n; return n;
} }
} }