diff --git a/src/coreEnforcer.ts b/src/coreEnforcer.ts index f725f15..e46c870 100644 --- a/src/coreEnforcer.ts +++ b/src/coreEnforcer.ts @@ -595,7 +595,7 @@ export class CoreEnforcer { if (explainIndex === -1) { return [res, []]; } - return [res, p?.policy[explainIndex]]; + return [res, p?.policy?.[explainIndex] || []]; } return res;