Fixes NPE when closing before initializing TransitionManager.

This use case appears when testing the UI.