Ensure MapAccessor#canWrite only returns true for a Map target

Closes gh-33265
This commit is contained in:
Sam Brannen
2024-07-23 18:26:53 +03:00
parent 4684a17f00
commit 4fa9781549
2 changed files with 17 additions and 1 deletions

View File

@@ -81,7 +81,7 @@ public class MapAccessor implements CompilablePropertyAccessor {
@Override
public boolean canWrite(EvaluationContext context, @Nullable Object target, String name) throws AccessException {
return this.allowWrite;
return (this.allowWrite && target instanceof Map);
}
@Override