Fix bug in console.html when runPython returns None [skip ci] (#1741)

This commit is contained in:
Hood Chatham 2021-07-23 15:34:48 +00:00 committed by GitHub
parent 5451ae8096
commit 684269285b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -81,11 +81,15 @@
}) })
); );
} }
if (value.destroy) { if (value && value.destroy) {
value.destroy(); value.destroy();
} }
} catch (e) { } catch (e) {
if (e.constructor.name === "PythonError") {
term.error(fut.formatted_error.trimEnd()); term.error(fut.formatted_error.trimEnd());
} else {
throw e;
}
} }
fut.destroy(); fut.destroy();
} }