From 104d3b51295e8fc1dbd87557d748aebc9a53aba4 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 10 May 2022 10:15:46 +0800 Subject: [PATCH] ... --- .../java/io/renren/modules/resource/dto/ResourceDTO.java | 6 +++--- .../modules/resource/entity/ResourceEntityDelFlag.java | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java index a4ed16b9..ec0f58e1 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java @@ -99,13 +99,13 @@ public class ResourceDTO implements Serializable { public String getDelFlagTip() { if (this.delFlag != null) { - Optional resourceEntityDelFlagOptional = Optional.of(ResourceEntityDelFlag.getByFlag(this.delFlag)); + Optional resourceEntityDelFlagOptional = Optional.ofNullable(ResourceEntityDelFlag.getByFlag(this.delFlag)); if (resourceEntityDelFlagOptional.isPresent()) { return resourceEntityDelFlagOptional.get().getTip(); } - return delFlagTip; + return ""; } - return delFlagTip; + return ""; } public void setDelFlagTip(String delFlagTip) { diff --git a/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntityDelFlag.java b/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntityDelFlag.java index 65eba940..0f97a212 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntityDelFlag.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntityDelFlag.java @@ -25,9 +25,6 @@ public enum ResourceEntityDelFlag { } public static ResourceEntityDelFlag getByFlag(int flag) { - if (flag < 1 || flag > ResourceEntityDelFlag.values().length) { - return null; - } ResourceEntityDelFlag[] index = ResourceEntityDelFlag.values(); return Arrays.asList(index).stream().filter(index_ -> index_.flag == flag).findAny().orElse(null); }