Catch nullpointer in disconnect.