Skip to content

Commit

Permalink
Fix error when table not found
Browse files Browse the repository at this point in the history
  • Loading branch information
bnmnetp committed Dec 20, 2023
1 parent e9d49f0 commit 0ad0e5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ function $builtinmodule() {
if (Sk.divid !== undefined && window.componentMap !== undefined) {
if (Sk.gradeContainer != Sk.divid) {
var edKey = Sk.gradeContainer + " " + Sk.divid;
return new Sk.builtin.str(
window.componentMap[edKey].editor.getValue()
);
if (edKey in window.componentMap) {
return new Sk.builtin.str(
window.componentMap[edKey].editor.getValue()
);
} else {
return new Sk.builtin.str(
window.componentMap[Sk.divid].editor.getValue()
);
}
}
return new Sk.builtin.str(
window.componentMap[Sk.divid].editor.getValue()
Expand Down
4 changes: 2 additions & 2 deletions src/lib/unittest/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def showSummary(self):

except:
print(
"failed to find object to record unittest results! {}".format(
pctcorrect
"failed to find object to record unittest results in {}! {}".format(
self.closestDiv, pctcorrect
)
)

0 comments on commit 0ad0e5f

Please sign in to comment.