From c951a8fd6afb70ecdbbf76e3424ec5107133e254 Mon Sep 17 00:00:00 2001 From: Coki <92775570+HashCookie@users.noreply.github.com> Date: Fri, 10 Jan 2025 21:55:02 +0800 Subject: [PATCH] feat: use empty array [] as reason for enforceEx() (#496) --- src/coreEnforcer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;