Fix assertion related UI process crash by checking if selector is present.
<rdar://problem/118569476>
Pull request: https://github.com/WebKit/WebKit/pull/20678
Committed 270910@main (d08dfb4672fe): <https://commits.webkit.org/270910@main> Reviewed commits have been landed. Closing PR #20678 and removing active labels.