From ad60877951006ab1e50106796d393ffee98c110a Mon Sep 17 00:00:00 2001 From: Matthias Behr Date: Tue, 5 Jan 2021 21:36:06 +0100 Subject: [PATCH] fix(restquery): treat ecu=null as undefined We do accept ecu="null" as ECU named "null" but treat ecu=null as no ecu specified. --- src/dltDocumentProvider.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dltDocumentProvider.ts b/src/dltDocumentProvider.ts index c837ea07..32a0f1c7 100644 --- a/src/dltDocumentProvider.ts +++ b/src/dltDocumentProvider.ts @@ -902,9 +902,12 @@ export class DltDocumentProvider implements vscode.TreeDataProvider p1); - if (ecuNameFilter.length === 0) { ecuNameFilter = undefined; } else { - console.log(`restQueryDocsEcus got ecuNameFilter='${ecuNameFilter}'`); + // we treat 'null' as undefined but "null" as ECU named null. + if (ecuNameFilter === 'null') { ecuNameFilter = undefined; } else { + ecuNameFilter = ecuNameFilter.replace(/^"(.*?)"$/g, (match, p1, offset) => p1); + if (ecuNameFilter.length === 0) { ecuNameFilter = undefined; } else { + console.log(`restQueryDocsEcus got ecuNameFilter='${ecuNameFilter}'`); + } } } });