Fix NPE during accessing connections in list