🐞 bug report
Is this a regression?
Yes
Description
The canDeactivate guard is called with a null component
🔬 Minimal Reproduction
🌍 Your Environment
Angular Version:
11.0.8 (but not specific to this version, I can reproduce it in other versions)
Closing as working as expected. There’s no
router-outlet
in the application so there is also no activated component. In this casenull
makes sense. We tried introducing a warning message for this case, but it’s a very common scenario in tests, see #38804 (comment).