diff --git a/extensions/php/src/features/validationProvider.ts b/extensions/php/src/features/validationProvider.ts index 41bae2878dc..d02352898d2 100644 --- a/extensions/php/src/features/validationProvider.ts +++ b/extensions/php/src/features/validationProvider.ts @@ -129,10 +129,10 @@ export default class PHPValidationProvider { if (section) { this.validationEnabled = section.get('validate.enable', true); let inspect = section.inspect('validate.executablePath'); - if (inspect.workspaceValue) { + if (inspect && inspect.workspaceValue) { this.executable = inspect.workspaceValue; this.executableIsUserDefined = false; - } else if (inspect.globalValue) { + } else if (inspect && inspect.globalValue) { this.executable = inspect.globalValue; this.executableIsUserDefined = true; } else {