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

Commit 8972d67

Browse files
committed
Fix: get post_return properly.
1 parent aa4b5be commit 8972d67

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

runestone/common/js/runestonebase.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,16 @@ export default class RunestoneBase {
157157
throw new Error(`Failed to save the log entry
158158
Status: ${response.status}`);
159159
}
160-
post_return = response.json();
160+
post_return = await response.json();
161161
} catch (e) {
162162
let detail = "none";
163-
if (post_return.detail) {
163+
if (post_return && post_return.detail) {
164164
detail = post_return.detail;
165165
}
166166
if (eBookConfig.loginRequired) {
167-
alert(`Error: Your action was not saved!
168-
The error was ${e}
169-
Detail: ${detail}.
167+
alert(`Error: Your action was not saved!
168+
The error was ${e}
169+
Detail: ${detail}.
170170
Please report this error!`);
171171
}
172172
// send a request to save this error

0 commit comments

Comments
 (0)