File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { ErrorHandler } from "./errorHandler";
1313import { WebviewProvider } from "./webviewProvider" ;
1414import { ApiService } from "./apiService" ;
1515import { PasswordManager } from "./PasswordManager" ;
16+ import { isBlank } from "./utils/pawsqlUtils" ;
1617
1718export class PawSQLExtension {
1819 private readonly decorationManager : DecorationManager ;
@@ -56,11 +57,11 @@ export class PawSQLExtension {
5657 ) : Promise < void > {
5758 try {
5859 const config = vscode . workspace . getConfiguration ( "pawsql" ) ;
59- const email = config . get < string > ( "email" ) ;
60- const password = await this . passwordManager . getPassword ( ) ;
61- const backendUrl = config . get < string > ( "backendUrl" ) ;
60+ const email = config . get < string > ( "email" ) ?? "" ;
61+ const password = ( await this . passwordManager . getPassword ( ) ) ?? "" ;
62+ const backendUrl = config . get < string > ( "backendUrl" ) ?? "" ;
6263
63- if ( ! email || ! password || ! backendUrl ) {
64+ if ( isBlank ( email ) || isBlank ( password ) || isBlank ( backendUrl ) ) {
6465 return ;
6566 }
6667
Original file line number Diff line number Diff line change @@ -150,3 +150,15 @@ const findNextValidQuery = (
150150
151151 return null ;
152152} ;
153+
154+ export function isNotBlank (
155+ a : string | null | undefined
156+ ) : a is Exclude < string , null | undefined > {
157+ return a !== undefined && a !== null && a !== "" ;
158+ }
159+
160+ export function isBlank (
161+ a : string | null | undefined
162+ ) : a is Exclude < string , null | undefined > {
163+ return a === undefined || a === null || a === "" ;
164+ }
You can’t perform that action at this time.
0 commit comments