From fb767b755318616cb4d0d996cdf760536184c8f4 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford Date: Wed, 27 Feb 2019 18:12:44 -0800 Subject: [PATCH] Fix exception on first button click --- test/integration/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/index.html b/test/integration/index.html index e3d8dd8..50d4b69 100644 --- a/test/integration/index.html +++ b/test/integration/index.html @@ -29,7 +29,10 @@ vm.attachV2BitmapAdapter(new ScratchSVGRenderer.BitmapAdapter()); document.getElementById('file').addEventListener('click', e => { - document.body.removeChild(document.getElementById('loaded')); + const loaded = document.getElementById('loaded'); + if (loaded) { + document.body.removeChild(loaded); + } }); document.getElementById('file').addEventListener('change', e => {