nsHTMLEditRules::ReapplyCachedStyles() may be called after the document is removed from the DOM tree. For example, the document can be removed from the tree even during handling an edit operation if the web contents uses DOMMutationEvent. In such case, nsIEditor::GetSelection() returns nullptr and it should do nothing.
MozReview-Commit-ID: Jk3eGalAPhB
--HG--
extra : rebase_source : 54b8eb0ace2c656a68cd8aaf0edd3d1177b127ff