Fix error in open file scenario. (#3986)

* Fix error in open file scenario.
This commit is contained in:
Sean McManus
2019-07-26 14:50:08 -07:00
committed by GitHub
parent d9de95ca15
commit baf6f50be3
@@ -178,7 +178,7 @@ export class CppProperties {
// defaultPaths is only used when there isn't a c_cpp_properties.json, but we don't send the configuration changed event
// to the language server until the default include paths and frameworks have been sent.
let configFilePath: string = path.join(this.configFolder, "c_cpp_properties.json");
if (fs.existsSync(configFilePath)) {
if (this.rootUri !== null && fs.existsSync(configFilePath)) {
this.propertiesFile = vscode.Uri.file(configFilePath);
} else {
this.propertiesFile = null;