[TextEditor] Fixed a potential null reference exception in
SearchPatternWorkerDoWork.