From ec27d31012cd58a20adb8b6c050ee3afab933803 Mon Sep 17 00:00:00 2001 From: guqing Date: Fri, 22 Sep 2023 16:28:14 +0800 Subject: [PATCH] chore: remove if case --- .../java/run/halo/app/theme/router/ViewNameResolver.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/src/main/java/run/halo/app/theme/router/ViewNameResolver.java b/application/src/main/java/run/halo/app/theme/router/ViewNameResolver.java index 42ce51fafb..de53492ca3 100644 --- a/application/src/main/java/run/halo/app/theme/router/ViewNameResolver.java +++ b/application/src/main/java/run/halo/app/theme/router/ViewNameResolver.java @@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties; import org.springframework.stereotype.Component; +import org.springframework.util.Assert; import org.springframework.web.reactive.function.server.ServerRequest; import reactor.core.publisher.Mono; import run.halo.app.theme.ThemeResolver; @@ -43,9 +44,7 @@ public Mono resolveViewNameOrDefault(ServerRequest request, String name, } String computeResourceName(String name) { - if (StringUtils.isBlank(name)) { - return name; - } + Assert.notNull(name, "Name must not be null"); return StringUtils.endsWith(name, thymeleafProperties.getSuffix()) ? name : name + thymeleafProperties.getSuffix(); }