fix: Prevent invocations of 'GET /rest/license' from returning an error when ephemeral licenses are used (#6154)

* fix: Prevent error when invoking  with an ephemeral license

* add tests
This commit is contained in:
Cornelius Suermann
2023-05-03 10:43:13 +02:00
committed by GitHub
parent 8862e1e7df
commit a3d26eff79
2 changed files with 41 additions and 5 deletions

View File

@@ -168,8 +168,7 @@ export class License {
}
return entitlements.find(
(entitlement) =>
(entitlement.productMetadata.terms as unknown as { isMainPlan: boolean }).isMainPlan,
(entitlement) => (entitlement.productMetadata?.terms as { isMainPlan?: boolean })?.isMainPlan,
);
}