瀏覽代碼

防止空指针

詹子聪 5 年之前
父節點
當前提交
5d5a45e309

+ 12 - 0
src/main/java/com/miekir/shibei/controller/api/SystemController.java

@@ -145,6 +145,18 @@ public class SystemController {
         return JSON.toJSONString(responseResult);
     }
 
+
+    /*如果配置
+    #自动保存的图片
+    location /auto/ {
+        alias /file/eden/images/auto/;
+    }
+    不起作用,那么就用这个:
+    location ^~ /auto/ {
+        alias /file/eden/images/auto/;
+    }
+    访问:http://jianjie.life/auto/xx.jpg
+    */
     /**
      * 查询版本更新信息
      */

+ 1 - 1
src/main/java/com/miekir/shibei/controller/task/CrawlerService.java

@@ -37,7 +37,7 @@ public class CrawlerService {
     @PostConstruct
     public void init() {
         SystemBean systemBean = systemRepository.findSystemBean();
-        if (!systemBean.isWalking) {
+        if (systemBean == null || !systemBean.isWalking) {
             return;
         }