File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
components/gitpod-protocol/src/util Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -81,5 +81,9 @@ export class ParseWorkspaceIdTest {
8181 const actual = matchesNewWorkspaceIdExactly ( "moccasin-ferret-15599b3" ) ;
8282 expect ( actual ) . to . be . false ;
8383 }
84+ @test public matchesWorkspaceIdExactly_new_negative_empty ( ) {
85+ const actual = matchesNewWorkspaceIdExactly ( undefined ) ;
86+ expect ( actual ) . to . be . false ;
87+ }
8488}
8589module . exports = new ParseWorkspaceIdTest ( ) ;
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ export const matchesInstanceIdOrLegacyWorkspaceIdExactly = function (maybeId: st
4949 * @param maybeWorkspaceId
5050 * @returns
5151 */
52- export const matchesNewWorkspaceIdExactly = function ( maybeWorkspaceId : string ) : boolean {
52+ export const matchesNewWorkspaceIdExactly = function ( maybeWorkspaceId ?: string ) : boolean {
53+ if ( ! maybeWorkspaceId ) {
54+ return false ;
55+ }
56+
5357 return REGEX_WORKSPACE_ID_EXACT . test ( maybeWorkspaceId ) ;
5458} ;
You can’t perform that action at this time.
0 commit comments