Skip to content

Commit bdfbd93

Browse files
committed
bah
1 parent c4acf59 commit bdfbd93

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎v3/js/composingprograms.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ $(document).ready(function() {
197197
}
198198

199199
function executeCodeFromScratch() {
200+
// don't execute empty string:
201+
if ($.trim(pyInputCodeMirror.getValue()) == '') {
202+
alert('Type in some code to visualize.');
203+
return;
204+
}
205+
200206
// reset these globals
201207
rawInputLst = [];
202208
executeCode();

‎v3/js/csc108h.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ $(document).ready(function() {
200200
}
201201

202202
function executeCodeFromScratch() {
203+
// don't execute empty string:
204+
if ($.trim(pyInputCodeMirror.getValue()) == '') {
205+
alert('Type in some code to visualize.');
206+
return;
207+
}
208+
203209
// reset these globals
204210
rawInputLst = [];
205211
executeCode();

0 commit comments

Comments
 (0)