File tree 1 file changed +12
-6
lines changed
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 {
207
207
this . webviewPanel . dispose ( ) ;
208
208
}
209
209
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
+ }
216
222
217
223
this . webviewPanel = vscode . window . createWebviewPanel (
218
224
this . id ,
You can’t perform that action at this time.
0 commit comments