Protecting against null reference

When close request is performed on a notification that has already been closed, a null reference might occasionally occur. This fix avoids the null reference exception. Thanks!