From ecf47259835930d60177483c02894fbdb46fb2db Mon Sep 17 00:00:00 2001 From: haolihi <1252445494@qq.com> Date: Thu, 1 Dec 2022 14:46:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98:19598,?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E8=AF=A6=E6=83=85=E9=A1=B5=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E9=97=AA=E9=80=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/src/main/js/MainAbility/pages/detail/detail.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js b/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js index cbeacd77..0486ddbd 100644 --- a/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js +++ b/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js @@ -110,6 +110,8 @@ export default { }, onDestroy() { - this.deviceMag.release(); + if (this.deviceMag !== null && JSON.stringify(this.deviceMag) !== '{}') { + this.deviceMag.release(); + } } }; -- Gitee From e8a1f082dde49b7188c15654d050891e5638739a Mon Sep 17 00:00:00 2001 From: haolihi <1252445494@qq.com> Date: Thu, 1 Dec 2022 15:55:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E8=BF=94=E5=9B=9E=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E9=97=AA=E9=80=80=E9=97=AE=E9=A2=98,19598?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: haolihi <1252445494@qq.com> --- .../entry/src/main/js/MainAbility/pages/detail/detail.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js b/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js index cbeacd77..0486ddbd 100644 --- a/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js +++ b/Distributed/NewsDemo/entry/src/main/js/MainAbility/pages/detail/detail.js @@ -110,6 +110,8 @@ export default { }, onDestroy() { - this.deviceMag.release(); + if (this.deviceMag !== null && JSON.stringify(this.deviceMag) !== '{}') { + this.deviceMag.release(); + } } }; -- Gitee