From f09aa322d63f0b5dc74fbc8ad789e6690e84fa7c Mon Sep 17 00:00:00 2001 From: Lkeme <19500576+lkeme@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:14:51 +0800 Subject: [PATCH] [fix] some known bug --- docs/DOC.md | 7 +++++-- plugin/CheckUpdate/CheckUpdate.php | 5 +++++ plugin/Judge/Judge.php | 5 ++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/DOC.md b/docs/DOC.md index a704c2f..68cbf93 100644 --- a/docs/DOC.md +++ b/docs/DOC.md @@ -192,8 +192,11 @@ $ docker run -itd --rm -e USER_NAME=你的B站登录账号 -e USER_PASSWORD=你 - 通过配置文件进行传入(能保留登录状态,自定义配置) -1. 下载[配置文件](https://raw.githubusercontent.com/lkeme/BiliHelper-personal/master/conf/user.ini.example) -2. 修改 +[//]: # (1. 下载[配置文件](https://raw.githubusercontent.com/lkeme/BiliHelper-personal/master/conf/user.ini.example)) + +[//]: # (2. 修改) +1. 下载[配置文件夹](https://github.com/lkeme/BiliHelper-personal/tree/master/profile) `注意是文件夹,可以完整下载后提出来` +2. 重命名 `profile/example -> profile/user` , 修改 `profile/user/config/user.ini` 3. 通过下面的命令进行挂载并运行 ```shell script diff --git a/plugin/CheckUpdate/CheckUpdate.php b/plugin/CheckUpdate/CheckUpdate.php index 651ea1d..291fa3e 100644 --- a/plugin/CheckUpdate/CheckUpdate.php +++ b/plugin/CheckUpdate/CheckUpdate.php @@ -120,6 +120,11 @@ class CheckUpdate extends BasePluginRW $branch = getConf('app.branch'); $url = $this->resource->get($branch . '_raw_url'); $payload = []; + // 防止错误拉取 + if (is_null($url)) { + return json_decode('{"code":404}', false); + } + // return Request::getJson(false, 'other', $url, $payload); } diff --git a/plugin/Judge/Judge.php b/plugin/Judge/Judge.php index 4ec7ce0..263ed72 100644 --- a/plugin/Judge/Judge.php +++ b/plugin/Judge/Judge.php @@ -204,6 +204,10 @@ class Judge extends BasePlugin Log::warning("風機委員: 獲取案件{$case_id}衆議觀點失敗 {$response['code']} -> {$response['message']}"); return []; } + // 防止为空 null + if (is_null($response['data']['list']) || $response['data']['total'] == 0) { + return []; + } return $response['data']['list']; } @@ -349,4 +353,3 @@ class Judge extends BasePlugin return true; } } - \ No newline at end of file