From be55bdbc8935beb3714cb189f00019c136c3d922 Mon Sep 17 00:00:00 2001 From: Lukas Mertens Date: Fri, 12 Apr 2024 11:25:16 +0200 Subject: [PATCH] fix(config_model): handling case when interface parent not found Closes #137 Signed-off-by: Lukas Mertens commit-id:7e4fdb93 --- src/modules/evbc/config_model.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/modules/evbc/config_model.ts b/src/modules/evbc/config_model.ts index 688f8a89..fa2f2246 100644 --- a/src/modules/evbc/config_model.ts +++ b/src/modules/evbc/config_model.ts @@ -244,11 +244,9 @@ class EVConfigModel { return this._instances[id]; } - interfaces_match(provide: string, requirement: string) { - if (provide === requirement) return true; - // still difficult to read :( - if (this._interface_parents[provide].has(requirement)) return true; - return false; + interfaces_match(provide: string, requirement: string): boolean { + return provide === requirement || + (this._interface_parents[provide]?.has(requirement) ?? false); } serialize(): EverestConfig {