From e520b3a6061ad30c311767a9de4f007cf6c34417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Thu, 2 Mar 2023 09:13:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E8=8E=B7=E5=8F=96=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=8D=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/ba/Depends.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extend/ba/Depends.php b/extend/ba/Depends.php index 3f12e5d5..7f5f4579 100644 --- a/extend/ba/Depends.php +++ b/extend/ba/Depends.php @@ -75,7 +75,12 @@ class Depends */ public function getDepends(bool $devEnv = false) { - $content = $this->getContent(); + try { + $content = $this->getContent(); + } catch (Exception $e) { + return []; + } + if ($this->type == 'npm') { return $devEnv ? $content['devDependencies'] : $content['dependencies']; } else {