Hot fix NullPointerException bug in network generation