mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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:
2
src/sql/azdata.d.ts
vendored
2
src/sql/azdata.d.ts
vendored
@@ -948,7 +948,7 @@ declare module 'azdata' {
|
|||||||
hasError: boolean;
|
hasError: boolean;
|
||||||
id: number;
|
id: number;
|
||||||
selection: ISelectionData;
|
selection: ISelectionData;
|
||||||
resultSetSummaries: ResultSetSummary[];
|
resultSetSummaries: ResultSetSummary[] | null;
|
||||||
executionElapsed: string;
|
executionElapsed: string;
|
||||||
executionEnd: string;
|
executionEnd: string;
|
||||||
executionStart: string;
|
executionStart: string;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ export class QueryResultsView extends Disposable {
|
|||||||
private hasResults(runner: QueryRunner): boolean {
|
private hasResults(runner: QueryRunner): boolean {
|
||||||
let hasResults = false;
|
let hasResults = false;
|
||||||
for (const batch of runner.batchSets) {
|
for (const batch of runner.batchSets) {
|
||||||
if (batch.resultSetSummaries.length > 0) {
|
if (batch.resultSetSummaries?.length > 0) {
|
||||||
hasResults = true;
|
hasResults = true;
|
||||||
break;
|
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) => {
|
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;
|
return rp + rc.rowCount;
|
||||||
}, 0);
|
}, 0) ?? 0;
|
||||||
|
return p + cnt;
|
||||||
}, 0);
|
}, 0);
|
||||||
const text = localize('rowCount', "{0} rows", rowCount.toLocaleString());
|
const text = localize('rowCount', "{0} rows", rowCount.toLocaleString());
|
||||||
this.statusItem.update({ text, ariaLabel: text });
|
this.statusItem.update({ text, ariaLabel: text });
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export interface BatchStartSummary {
|
|||||||
|
|
||||||
export interface BatchSummary extends BatchStartSummary {
|
export interface BatchSummary extends BatchStartSummary {
|
||||||
hasError: boolean;
|
hasError: boolean;
|
||||||
resultSetSummaries: ResultSetSummary[];
|
resultSetSummaries: ResultSetSummary[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CompleteBatchSummary extends BatchSummary {
|
export interface CompleteBatchSummary extends BatchSummary {
|
||||||
|
|||||||
Reference in New Issue
Block a user