mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
add null check for errors in the console while using query editor (#15711)
* add null check * another null check * pr comments * update typing
This commit is contained in:
@@ -201,7 +201,7 @@ export class QueryResultsView extends Disposable {
|
||||
private hasResults(runner: QueryRunner): boolean {
|
||||
let hasResults = false;
|
||||
for (const batch of runner.batchSets) {
|
||||
if (batch.resultSetSummaries.length > 0) {
|
||||
if (batch.resultSetSummaries?.length > 0) {
|
||||
hasResults = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -193,11 +193,12 @@ export class RowCountStatusBarContributions extends Disposable implements IWorkb
|
||||
}
|
||||
}
|
||||
|
||||
private _displayValue(runner: QueryRunner) {
|
||||
private _displayValue(runner: QueryRunner): void {
|
||||
const rowCount = runner.batchSets.reduce((p, c) => {
|
||||
return p + c.resultSetSummaries.reduce((rp, rc) => {
|
||||
const cnt = c.resultSetSummaries?.reduce((rp, rc) => {
|
||||
return rp + rc.rowCount;
|
||||
}, 0);
|
||||
}, 0) ?? 0;
|
||||
return p + cnt;
|
||||
}, 0);
|
||||
const text = localize('rowCount', "{0} rows", rowCount.toLocaleString());
|
||||
this.statusItem.update({ text, ariaLabel: text });
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface BatchStartSummary {
|
||||
|
||||
export interface BatchSummary extends BatchStartSummary {
|
||||
hasError: boolean;
|
||||
resultSetSummaries: ResultSetSummary[];
|
||||
resultSetSummaries: ResultSetSummary[] | null;
|
||||
}
|
||||
|
||||
export interface CompleteBatchSummary extends BatchSummary {
|
||||
|
||||
Reference in New Issue
Block a user