mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add more to strict nulls (#11871)
* add more to strict nulls * maintain error handling properly * fix lint
This commit is contained in:
@@ -13,7 +13,7 @@ import { AccountPicker } from 'sql/workbench/services/accountManagement/browser/
|
||||
export class AccountPickerService implements IAccountPickerService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _accountPicker: AccountPicker;
|
||||
private _accountPicker?: AccountPicker;
|
||||
|
||||
// EVENTING ////////////////////////////////////////////////////////////
|
||||
private _addAccountCompleteEmitter: Emitter<void>;
|
||||
@@ -38,7 +38,7 @@ export class AccountPickerService implements IAccountPickerService {
|
||||
this._addAccountCompleteEmitter = new Emitter<void>();
|
||||
this._addAccountErrorEmitter = new Emitter<string>();
|
||||
this._addAccountStartEmitter = new Emitter<void>();
|
||||
this._onAccountSelectionChangeEvent = new Emitter<azdata.Account>();
|
||||
this._onAccountSelectionChangeEvent = new Emitter<azdata.Account | undefined>();
|
||||
this._onTenantSelectionChangeEvent = new Emitter<string | undefined>();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,11 @@ export class AccountPickerService implements IAccountPickerService {
|
||||
* Get selected account
|
||||
*/
|
||||
public get selectedAccount(): azdata.Account | undefined {
|
||||
return this._accountPicker.viewModel.selectedAccount;
|
||||
if (this._accountPicker) {
|
||||
return this._accountPicker.viewModel.selectedAccount;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user