Fix NRE with accessint model reference after it has been nulled.