From 60ebfde91e9c975f59df4d60a6cb5a7861958bd2 Mon Sep 17 00:00:00 2001
From: shinnosuke <tantao@1hoper.com>
Date: 星期三, 30 九月 2026 17:04:37 +0800
Subject: [PATCH] fix(live): 修复管理端「编辑」「查看」直播内容报 500 的问题
---
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSysLiveServiceImpl.java | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSysLiveServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSysLiveServiceImpl.java
index 7b7cfa7..3e6f2b6 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSysLiveServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSysLiveServiceImpl.java
@@ -50,8 +50,10 @@
public R pushUser(String id, String pushType) {
TSysLive sysLive = this.getById(id);
if (Objects.nonNull(sysLive)){
- // 判断直播开始时间是否在当前时间之后
- if (sysLive.getContentType()==1 && sysLive.getStartTime().isBefore(LocalDateTime.now())){
+ // 判断直播开始时间是否在当前时间之后(contentType / startTime 可能为空,需判空)
+ if (Objects.nonNull(sysLive.getContentType()) && sysLive.getContentType() == 1
+ && Objects.nonNull(sysLive.getStartTime())
+ && sysLive.getStartTime().isBefore(LocalDateTime.now())){
return R.fail("直播已开始,无法配置推送");
}
sysLive.setPushType(pushType);
--
Gitblit v1.7.1