File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ export async function createView(
2323export async function createTree (
2424 view : SideBarView | undefined
2525) : Promise < CustomTreeSection | undefined > {
26- return ( await view
27- ?. getContent ( )
28- . getSection ( "Checkmarx One Results" ) ) as CustomTreeSection ;
26+ const content = view ?. getContent ( ) ;
27+ if ( ! content ) return undefined ;
28+ return await content . getSection < CustomTreeSection > ( "Checkmarx One Results" , CustomTreeSection ) ;
2929}
3030
3131export async function initialize ( ) : Promise < CustomTreeSection | undefined > {
@@ -49,9 +49,9 @@ export async function initializeSCA(): Promise<CustomTreeSection | undefined> {
4949export async function createTreeSCA (
5050 view : SideBarView | undefined
5151) : Promise < CustomTreeSection | undefined > {
52- return ( await view
53- ?. getContent ( )
54- . getSection ( "Checkmarx SCA Realtime Scanner" ) ) as CustomTreeSection ;
52+ const content = view ?. getContent ( ) ;
53+ if ( ! content ) return undefined ;
54+ return await content . getSection < CustomTreeSection > ( "Checkmarx SCA Realtime Scanner" , CustomTreeSection ) ;
5555}
5656
5757export async function quickPickSelector ( input : InputBox ) {
You can’t perform that action at this time.
0 commit comments