From 684269285b5341c72e5a95e020c9884360e0faab Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Fri, 23 Jul 2021 15:34:48 +0000 Subject: [PATCH] Fix bug in console.html when runPython returns None [skip ci] (#1741) --- src/templates/console.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/templates/console.html b/src/templates/console.html index ec2978353..a3eb7edd8 100644 --- a/src/templates/console.html +++ b/src/templates/console.html @@ -81,11 +81,15 @@ }) ); } - if (value.destroy) { + if (value && value.destroy) { value.destroy(); } } catch (e) { - term.error(fut.formatted_error.trimEnd()); + if (e.constructor.name === "PythonError") { + term.error(fut.formatted_error.trimEnd()); + } else { + throw e; + } } fut.destroy(); }