@@ -464,7 +464,7 @@ private void scanToNormalizeValues(String path, JsonElement parent, String name,
464464 }
465465 }
466466 }
467- } else if (element .isJsonObject ()) {
467+ } else if (element != null && element .isJsonObject ()) {
468468 if (name != null && name .equals ("file" )) {
469469 if (path .startsWith ("/audit/v1/schemas" ) || path .startsWith ("/audit/v1/actions" )) {
470470 return ;
@@ -493,6 +493,20 @@ private void scanToNormalizeValues(String path, JsonElement parent, String name,
493493 }
494494 return ;
495495 }
496+ if (name != null && name .equals ("inputs" ) && path .equals ("/api/admin.apps.activities.list" )) {
497+ JsonObject permissions = element .getAsJsonObject ();
498+ try {
499+ // To avoid concurrent modification of the underlying objects
500+ List <String > oldKeys = new ArrayList <>();
501+ permissions .keySet ().iterator ().forEachRemaining (oldKeys ::add );
502+ for (String key : oldKeys ) {
503+ permissions .remove (key );
504+ }
505+
506+ } catch (Exception e ) {
507+ log .error (e .getMessage (), e );
508+ }
509+ }
496510 if (name != null && name .equals ("bookmark" )) {
497511 if (path .startsWith ("/audit/v1/schemas" ) || path .startsWith ("/audit/v1/actions" )) {
498512 return ;
@@ -724,7 +738,7 @@ private void scanToNormalizeValues(String path, JsonElement parent, String name,
724738 e .printStackTrace ();
725739 }
726740 }
727- } else if (element .isJsonNull ()) {
741+ } else if (element == null || element .isJsonNull ()) {
728742 return ;
729743 } else if (!parent .isJsonArray () && element .isJsonPrimitive ()) {
730744 JsonPrimitive prim = element .getAsJsonPrimitive ();
0 commit comments