Fix NPE on disconnect