DevTools: Defensive guard of Elements search results
DevTools: Defensive guard of Elements search results

There is a race condition between dismissing search and stepping
search which occasionally results in an unhandled exception having
been raised. Most of the code paths dealing with search in Elements
panel already defensively code against this; this change adds similar
tests in the unguarded code paths to what already exists, and alters
the declaration of the search-results variable so that Closure would
have correctly detected this condition previously.

Change-Id: I929b0851a5770fb26b1f73c682b86a7686a7ee80
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872879
Reviewed-by: John Emau <c153e6e600be23fb28cec0b08551440e4bf7575d@microsoft.com>
Reviewed-by: Lorne Mitchell <b024a4e2ee56b9b5450225fa7affa8f95408a018@microsoft.com>
Commit-Queue: John Emau <c153e6e600be23fb28cec0b08551440e4bf7575d@microsoft.com>

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