prevent NPE trying to close already nil'ed session