From c43d1784803445243b15a8e2f4c2def29d616c2d Mon Sep 17 00:00:00 2001 From: Carlos Alonso Turner Benites Date: Thu, 3 May 2018 00:15:36 -0500 Subject: [PATCH] fix: calling Spin.hide() continuously --- src/components/spin/spin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/spin/spin.js b/src/components/spin/spin.js index b1ca2fd..479496b 100644 --- a/src/components/spin/spin.js +++ b/src/components/spin/spin.js @@ -44,7 +44,9 @@ Spin.newInstance = properties => { spin.visible = false; setTimeout(function() { spin.$parent.$destroy(); - document.body.removeChild(document.getElementsByClassName('ivu-spin-fullscreen')[0]); + if (document.getElementsByClassName('ivu-spin-fullscreen')[0] !== undefined) { + document.body.removeChild(document.getElementsByClassName('ivu-spin-fullscreen')[0]); + } cb(); }, 500); }, @@ -52,4 +54,4 @@ Spin.newInstance = properties => { }; }; -export default Spin; \ No newline at end of file +export default Spin; -- libgit2 0.21.4