File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -424,10 +424,11 @@ export class CppProperties {
424
424
425
425
// Try to use the same configuration as before the change.
426
426
let newJson : ConfigurationJson = JSON . parse ( readResults ) ;
427
- if ( newJson . configurations . length === 0 ) {
427
+ if ( ! newJson || ! newJson . configurations || newJson . configurations . length === 0 ) {
428
428
throw { message : "Invalid configuration file. There must be at least one configuration present in the array." } ;
429
429
}
430
- if ( ! this . configurationIncomplete && newJson . configurations && this . configurationJson ) {
430
+ if ( ! this . configurationIncomplete && this . configurationJson && this . configurationJson . configurations &&
431
+ this . CurrentConfiguration < this . configurationJson . configurations . length ) {
431
432
for ( let i : number = 0 ; i < newJson . configurations . length ; i ++ ) {
432
433
if ( newJson . configurations [ i ] . name === this . configurationJson . configurations [ this . CurrentConfiguration ] . name ) {
433
434
this . currentConfigurationIndex . Value = i ;
You can’t perform that action at this time.
0 commit comments