Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit ed0670e

Browse files
committed
bug fixes:
* first save in html was not working * Better error message for missing db
1 parent 06bfe5a commit ed0670e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

runestone/activecode/js/activecode.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ function HTMLActiveCode (opts) {
13001300
HTMLActiveCode.prototype.runProg = function () {
13011301
var prog = this.buildProg(true);
13021302
var scrubber_dfd, history_dfd, saveCode;
1303-
1303+
var saveCode = "True"
13041304
var __ret = this.manage_scrubber(scrubber_dfd, history_dfd, saveCode);
13051305
history_dfd = __ret.history_dfd;
13061306
saveCode = __ret.saveCode;
@@ -2451,6 +2451,10 @@ SQLActiveCode.prototype.runProg = function() {
24512451
$(this.output).text("")
24522452
// Run this query
24532453
let query = this.buildProg(false); // false --> Do not include suffix
2454+
if (! this.db ) {
2455+
$(this.output).text(`Error: Database not initialized! DBURL: ${this.dburl}`)
2456+
return;
2457+
}
24542458
try {
24552459
var res = this.db.exec(query);
24562460
} catch(error) {

0 commit comments

Comments
 (0)