AS7-6482 Fix NPE on shutdown