From 11aa723d755bbe24168e1f9b67103af521b87c85 Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:25:40 +0800 Subject: [PATCH] fix(easy-admin): prevent js error when operat is not object When the operat parameter passed to the easy-admin.js plugin is not an object,it previously caused a JavaScript error. This fix adds a check to ensure that operat is indeed an object before processing it, thus preventing the error. --- public/static/plugs/easy-admin/easy-admin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/static/plugs/easy-admin/easy-admin.js b/public/static/plugs/easy-admin/easy-admin.js index 9c8da3e..ea7ebbc 100644 --- a/public/static/plugs/easy-admin/easy-admin.js +++ b/public/static/plugs/easy-admin/easy-admin.js @@ -614,7 +614,9 @@ define(["jquery", "tableSelect"], function ($, tableSelect) { } } else if (typeof item === 'object') { + $.each(item, function (i, operat) { + if (typeof operat !== 'object') return operat.class = operat.class || ''; operat.icon = operat.icon || ''; operat.auth = operat.auth || '';