From 69b86a3db5a163a4a07a34cfea336e63a5477415 Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Sun, 5 Sep 2021 14:23:48 +0200 Subject: [PATCH] remove logs and additional check Signed-off-by: Andrey Platov --- plugins/view-resources/src/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/view-resources/src/utils.ts b/plugins/view-resources/src/utils.ts index 0a25d824f9..0cf57d873e 100644 --- a/plugins/view-resources/src/utils.ts +++ b/plugins/view-resources/src/utils.ts @@ -28,7 +28,6 @@ export interface AttributeModel { } async function getObjectPresenter(client: Client, _class: Ref>, preserveKey: string): Promise { - console.log('getting object presenter for class', _class, 'key', preserveKey) const clazz = client.getHierarchy().getClass(_class) const presenterMixin = client.getHierarchy().as(clazz, view.mixin.AttributePresenter) if (presenterMixin.presenter === undefined) { @@ -47,7 +46,6 @@ async function getObjectPresenter(client: Client, _class: Ref>, prese } async function getAttributePresenter(client: Client, _class: Ref>, key: string, preserveKey: string) { - console.log('getting attribute presenter for class', _class) const attribute = client.getHierarchy().getAttribute(_class, key) const clazz = client.getHierarchy().getClass(attribute.type._class) const presenterMixin = client.getHierarchy().as(clazz, view.mixin.AttributePresenter) @@ -69,6 +67,9 @@ async function getPresenter(client: Client, _class: Ref>, key: string const split = key.split('.') if (split[0] === '$lookup') { const lookupClass = (options?.lookup as any)[split[1]] as Ref> + if (lookupClass === undefined) { + throw new Error('lookup class does not provided for ' + split[1]) + } const lookupKey = split[2] ?? '' const model = await getPresenter(client, lookupClass, lookupKey, preserveKey) if (lookupKey === '') {