[Elements Panel]: Fixing issue when ElementsPanel properties are unexpectedly undefined in _highlightCurrentSearchResult
[Elements Panel]: Fixing issue when ElementsPanel properties are unexpectedly undefined in _highlightCurrentSearchResult

Issue:
- Race condition between ElementsPanel._highlightCurrentSearchResult and ElementsPanel.searchCanceled
  - _highlightCurrentSearchResult expects _searchConfig, _currentSearchResultIndex and _searchResults to be defined
  - searchCanceled deletes all those properties and it triggers when the query is changed/deleted
  - These two functions happen asynchronously
- This error only occurs in the _highlightCurrentSearchResult call after DomModel.searchResult
- DomModel.searchResult takes a non-trivial amount of time - enough for searchCanceled to be called

Changes:
- Added an undefined check for the three properties after the DomModel.searchResult call so that it will not call _highlightCurrentSearchResult if it fails
- It should most likely be a no-op instead of passing in the pre-searchResult properties since if it has been changed, it means the search/highlighting is outdated.

Bug: 1078578
Change-Id: Ideddcdb058ed2b341297f7e11024417de42cdbd9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2183220
Reviewed-by: Songtao Xia <efb39a3e57dd0e7c4fd137171d5e7a3f041d1da6@microsoft.com>
Reviewed-by: Robert Paveza <7787129de3d0cb4911c68d958db3023863584560@microsoft.com>
Commit-Queue: Michael Liao <00d75d81082fdf74688ec453c516b42f7cbf0f40@microsoft.com>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend