diff --git a/include/jsoncons_ext/jmespath/jmespath.hpp b/include/jsoncons_ext/jmespath/jmespath.hpp index 419fbda9b..61f042928 100644 --- a/include/jsoncons_ext/jmespath/jmespath.hpp +++ b/include/jsoncons_ext/jmespath/jmespath.hpp @@ -790,7 +790,7 @@ namespace jmespath { sum += j.template as(); } - return arg0.size() == 0 ? resources.null_value() : *resources.create_json(sum / arg0.size()); + return sum == 0 ? resources.null_value() : *resources.create_json(sum/arg0.size()); } };