Fix error while deleting query history item

When deleting a query history item and the "next" query is still
running, the `completedQuery` is `undefined`. This commit fixes it by
using optional chaining to ensure that the `completedQuery` is defined
before accessing its `successful` property.
This commit is contained in:
Koen Vlaswinkel
2023-03-02 12:32:45 +01:00
parent 11b63f39b4
commit d574f3d94c

View File

@@ -399,7 +399,7 @@ export class ResultsView extends AbstractWebview<
forceReveal: WebviewReveal,
shouldKeepOldResultsWhileRendering = false,
): Promise<void> {
if (!fullQuery.completedQuery.successful) {
if (!fullQuery.completedQuery?.successful) {
return;
}