From 6f040b6c4090fbc060bf2a06a7a01b900f4fe890 Mon Sep 17 00:00:00 2001 From: ycjcl868 <45808948@qq.com> Date: Mon, 4 Feb 2019 22:55:00 +0800 Subject: [PATCH] fix: strict check input --- components/form/__tests__/label.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/form/__tests__/label.test.js b/components/form/__tests__/label.test.js index cba6dcb93c..e0deb006e5 100644 --- a/components/form/__tests__/label.test.js +++ b/components/form/__tests__/label.test.js @@ -11,8 +11,8 @@ describe('Form', () => { // Use origin logic if (id) { - const input = this.getElementsByTagName('input')[0]; - if (input.id === id) { + const [input] = this.getElementsByTagName('input'); + if (input && input.id === id) { return input; } }