From b2b2d0f6466afd026fc75d53e954bf281c97d001 Mon Sep 17 00:00:00 2001 From: rgantzos <86856959+rgantzos@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:58:23 -0700 Subject: [PATCH] Fix sometimes crashing paint editor --- api/vm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/vm.js b/api/vm.js index 8bf344cc..f587e948 100644 --- a/api/vm.js +++ b/api/vm.js @@ -183,7 +183,7 @@ ScratchTools.Scratch.scratchPaint = function () { Object.keys(app).find((key) => key.startsWith("__reactInternalInstance") ) - ].child.stateNode.store.getState()?.scratchPaint || null + ].child.stateNode.store?.getState()?.scratchPaint || null ); } else { return null;