Skip to content

Commit b3a2bc4

Browse files
committed
Tolerate empty cdpUri
1 parent 46add83 commit b3a2bc4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/php-wasm/xdebug-bridge/src/lib/xdebug-cdp-bridge.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,19 @@ export class XdebugCDPBridge {
301301
break;
302302
case 'Debugger.setBreakpointByUrl': {
303303
const { url: cdpUri, lineNumber: line } = params;
304+
/**
305+
* `url` is an optional parameter. If it's not set, we don't
306+
* have enough information to set a breakpoint so let's just
307+
* ignore the message.
308+
*
309+
* Why would `url` be not set? We don't know that yet.
310+
*
311+
* https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointByUrl
312+
*/
313+
if (!cdpUri) {
314+
sendResponse = false;
315+
break;
316+
}
304317
const bridgeUri = this.uriFromCDPToBridge(cdpUri);
305318
const dbgpUri = this.uriFromBridgeToDBGP(bridgeUri);
306319
const lineNumber = (typeof line === 'number' ? line : 0) + 1; // CDP lineNumber is 0-based, Xdebug expects 1-based

0 commit comments

Comments
 (0)