diff --git a/CHANGELOG.md b/CHANGELOG.md index f492f3a8..a1617fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.29.1] + +- Fix for env configuration check that sometimes causes an error. + ## [1.29.0] - Xdebug Cloud support. diff --git a/src/phpDebug.ts b/src/phpDebug.ts index cfb9a16a..04944d49 100644 --- a/src/phpDebug.ts +++ b/src/phpDebug.ts @@ -414,7 +414,12 @@ class PhpDebugSession extends vscode.DebugSession { }) try { // Some checks - if (args.env !== undefined && args.program === undefined && args.runtimeArgs === undefined) { + if ( + args.env && + Object.keys(args.env).length !== 0 && + args.program === undefined && + args.runtimeArgs === undefined + ) { throw new Error( `Cannot set env without running a program.\nPlease remove env from [${ args.name || 'unknown' diff --git a/src/test/adapter.ts b/src/test/adapter.ts index 2eb33f19..959e089a 100644 --- a/src/test/adapter.ts +++ b/src/test/adapter.ts @@ -41,7 +41,7 @@ describe('PHP Debug Adapter', () => { )) it('should error on env without program', () => - assert.isRejected(Promise.all([client.launch({ env: {} }), client.configurationSequence()]))) + assert.isRejected(Promise.all([client.launch({ env: { some: 'key' } }), client.configurationSequence()]))) it('should run program to the end', () => Promise.all([