File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,12 @@ export class PDKFeature implements IFeature {
9292 matchOnDescription : true ,
9393 matchOnDetail : true ,
9494 } ;
95- vscode . window . showInputBox ( nameOpts ) . then ( ( moduleName ) => {
96- this . terminal . sendText ( `pdk new class ${ moduleName } ` ) ;
95+ vscode . window . showInputBox ( nameOpts ) . then ( ( className ) => {
96+ if ( className === undefined ) {
97+ vscode . window . showWarningMessage ( 'No class name specifed. Exiting.' ) ;
98+ return ;
99+ }
100+ this . terminal . sendText ( `pdk new class ${ className } ` ) ;
97101 this . terminal . show ( ) ;
98102 if ( reporter ) {
99103 reporter . sendTelemetryEvent ( PDKCommandStrings . PdkNewClassCommandId ) ;
@@ -108,6 +112,10 @@ export class PDKFeature implements IFeature {
108112 matchOnDetail : true ,
109113 } ;
110114 vscode . window . showInputBox ( nameOpts ) . then ( ( taskName ) => {
115+ if ( taskName === undefined ) {
116+ vscode . window . showWarningMessage ( 'No task name specifed. Exiting.' ) ;
117+ return ;
118+ }
111119 this . terminal . sendText ( `pdk new task ${ taskName } ` ) ;
112120 this . terminal . show ( ) ;
113121 if ( reporter ) {
@@ -123,6 +131,10 @@ export class PDKFeature implements IFeature {
123131 matchOnDetail : true ,
124132 } ;
125133 vscode . window . showInputBox ( nameOpts ) . then ( ( typeName ) => {
134+ if ( typeName === undefined ) {
135+ vscode . window . showWarningMessage ( 'No defined type name specifed. Exiting.' ) ;
136+ return ;
137+ }
126138 this . terminal . sendText ( `pdk new defined_type ${ typeName } ` ) ;
127139 this . terminal . show ( ) ;
128140 if ( reporter ) {
You can’t perform that action at this time.
0 commit comments