Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ class PythonKernelMod {
// is indented the same amount. However, this only works if the first line
// is indented. We therefore trim empty lines at the start of the executed
// region.
code = code.replace(/^\n|\n$/g, '');
if (code != null) {
code = code.replace(/^\n|\n$/g, '');
}

next.execute(code, (msg, channel) => {
if (!makeReply && msg.parent_header) {
Expand Down