Core::self()->documentController()->documentForUrl(url) can return a nullptr and apparently does so reliably when running the plugins/clang/tests/test_assistants test on Mac.
This patch prevents crashing when that happens, but is it the most appropriate fix?