Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seq.max(coll) 存在报 NullPointerException 的问题 #537

Open
yang3shi opened this issue May 5, 2023 · 0 comments
Open

seq.max(coll) 存在报 NullPointerException 的问题 #537

yang3shi opened this issue May 5, 2023 · 0 comments

Comments

@yang3shi
Copy link

yang3shi commented May 5, 2023

【问题描述】
当指定的集合中存在 null 元素,且 null 位于集合的首位时,会抛出 NullPointerException。

【测试步骤】

Expression expr = AviatorEvaluator.compile("seq.max(coll)");
Map<String, Object> env = new HashMap<>();
env.put("coll", Arrays.asList(null, 1, 2));
Object obj = expr.execute(env);
System.out.println(obj);

【预期结果】
忽略集合中的 null 值,输出结果为 2

【实际结果】
报错 NullPointerException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant