Compositor::self()->scene() may return nullptr while compositing is being restarted. (cherry picked from commit da12d380)