Skip to content

Commit b2923f9

Browse files
committed
Fixed error when app has not been initialised.
1 parent dadb399 commit b2923f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/computes.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ export function computeJs(
187187
const code = e.data && e.data.code;
188188
const cursor = e.data && e.data.cursor;
189189
190-
if (code) {
191-
app && app.$store.commit('code', code);
190+
if (code && app) {
191+
app.$store.commit('code', code);
192192
}
193193
194-
if(cursor !== null || cursor !== undefined) {
195-
app && app.$store.state.cursor = cursor;
194+
if(app && (cursor !== null || cursor !== undefined)) {
195+
app.$store.state.cursor = cursor;
196196
}
197197
}, false);`;
198198

0 commit comments

Comments
 (0)