File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -207,12 +207,18 @@ class HtmlContentView extends CustomView {
207207 this . webviewPanel . dispose ( ) ;
208208 }
209209
210- let localResourceRoots : vscode . Uri [ ] = this . htmlContent . javaScriptPaths . map ( ( p ) => {
211- return vscode . Uri . parse ( path . dirname ( p ) ) ;
212- } ) ;
213- localResourceRoots = localResourceRoots . concat ( this . htmlContent . styleSheetPaths . map ( ( p ) => {
214- return vscode . Uri . parse ( path . dirname ( p ) ) ;
215- } ) ) ;
210+ let localResourceRoots : vscode . Uri [ ] = [ ] ;
211+ if ( this . htmlContent . javaScriptPaths ) {
212+ localResourceRoots = localResourceRoots . concat ( this . htmlContent . javaScriptPaths . map ( ( p ) => {
213+ return vscode . Uri . parse ( path . dirname ( p ) ) ;
214+ } ) ) ;
215+ }
216+
217+ if ( this . htmlContent . styleSheetPaths ) {
218+ localResourceRoots = localResourceRoots . concat ( this . htmlContent . styleSheetPaths . map ( ( p ) => {
219+ return vscode . Uri . parse ( path . dirname ( p ) ) ;
220+ } ) ) ;
221+ }
216222
217223 this . webviewPanel = vscode . window . createWebviewPanel (
218224 this . id ,
You can’t perform that action at this time.
0 commit comments