Attempt to fix the NPE caused by quitting

Signed-off-by: Steven Downer <grinch@outlook.com>