From f4ffee706b5a08c69a75019eee85c737f0541ffe Mon Sep 17 00:00:00 2001 From: zhaojun1998 Date: Sun, 16 Aug 2020 09:23:07 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E9=A9=B1=E5=8A=A8=E5=99=A8?= =?UTF-8?q?=E6=97=A0=E6=95=88=E6=97=B6,=20=E8=AE=BF=E9=97=AE=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=BE=E7=BD=AE,=20=E7=BB=99=E4=BA=88=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/im/zhaojun/zfile/service/SystemConfigService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/im/zhaojun/zfile/service/SystemConfigService.java b/src/main/java/im/zhaojun/zfile/service/SystemConfigService.java index 23ee04a..39e89ee 100644 --- a/src/main/java/im/zhaojun/zfile/service/SystemConfigService.java +++ b/src/main/java/im/zhaojun/zfile/service/SystemConfigService.java @@ -3,6 +3,7 @@ package im.zhaojun.zfile.service; import cn.hutool.core.convert.Convert; import cn.hutool.crypto.SecureUtil; import im.zhaojun.zfile.cache.ZFileCache; +import im.zhaojun.zfile.exception.InvalidDriveException; import im.zhaojun.zfile.model.constant.SystemConfigConstant; import im.zhaojun.zfile.model.dto.SystemConfigDTO; import im.zhaojun.zfile.model.dto.SystemFrontConfigDTO; @@ -120,6 +121,9 @@ public class SystemConfigService { BeanUtils.copyProperties(systemConfig, systemFrontConfigDTO); DriveConfig driveConfig = driveConfigService.findById(driveId); + if (driveConfig == null) { + throw new InvalidDriveException("此驱动器不存在或初始化失败, 请检查后台参数配置"); + } systemFrontConfigDTO.setSearchEnable(driveConfig.getSearchEnable()); return systemFrontConfigDTO; }