Skip to content

Commit b1cd6b1

Browse files
committed
Fix nullchecks for prettify
1 parent e9e195d commit b1cd6b1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/app/src/app/utils/prettify.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,18 @@ export default function prettify(
171171
reject({ error });
172172
}
173173

174-
if (result.formatted) {
174+
if (result && result.formatted != null) {
175175
resolve(result.formatted);
176176
}
177177

178-
const newCursorOffset = result.cursorOffset;
179-
180178
// After code is applied
181179
if (
182-
newCursorOffset &&
180+
result &&
181+
result.newCursorOffset &&
183182
isCurrentModule() &&
184183
result.formatted != null
185184
) {
185+
const newCursorOffset = result.cursorOffset;
186186
requestAnimationFrame(() => {
187187
// After model code has changed
188188
applyNewCursorOffset(newCursorOffset, result.formatted, getCode);

packages/app/src/sandbox/eval/transpilers/utils/worker-error-handler.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ type WorkerError = {
99
};
1010

1111
export function buildWorkerError(error: Error): WorkerError {
12-
console.log(error.lineNumber, error.columnNumber);
1312
return {
1413
name: error.name,
1514
message: error.message,

0 commit comments

Comments
 (0)