From 6222d0fac8b3ff846a2d279a36d89265e216d659 Mon Sep 17 00:00:00 2001 From: sjh Date: Sun, 17 Nov 2024 23:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=81=B5=E6=95=8F=E6=84=9F?= =?UTF-8?q?=E7=9F=A5=E5=A4=A7=E5=B1=8F3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/RiskStatisticsService.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java index ad08700..4a66aac 100644 --- a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java +++ b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java @@ -72,16 +72,18 @@ public class RiskStatisticsService { RiskStatisticsVo tmp = new RiskStatisticsVo(); tmp.setLabel(map.get("membersName").toString()); Object valueObj = map.get(type); - if (valueObj instanceof Long) { - tmp.setValue(((Long) valueObj).intValue()); - } else if (valueObj instanceof BigDecimal) { - tmp.setScore(((BigDecimal) valueObj).doubleValue()); - } else if (valueObj instanceof Double) { - tmp.setScore((Double) valueObj); - } else if (valueObj instanceof Integer) { - tmp.setValue((Integer) valueObj); - } else { - throw new IllegalArgumentException("Unsupported type: " + valueObj.getClass().getName()); + if (valueObj != null) { + if (valueObj instanceof Long) { + tmp.setValue(((Long) valueObj).intValue()); + } else if (valueObj instanceof BigDecimal) { + tmp.setScore(((BigDecimal) valueObj).doubleValue()); + } else if (valueObj instanceof Double) { + tmp.setScore((Double) valueObj); + } else if (valueObj instanceof Integer) { + tmp.setValue((Integer) valueObj); + } else { + throw new IllegalArgumentException("Unsupported type: " + valueObj.getClass().getName()); + } } result.add(tmp); }