Skip to content

Commit 7392feb

Browse files
committed
fix(playground): Cannot read property 'content' of undefined at e.value
1 parent c0f5fb8 commit 7392feb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/cubejs-playground/src/DashboardSource.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ class DashboardSource {
7272

7373
parse(sourceFiles) {
7474
this.appFile = sourceFiles.find(f => f.fileName.indexOf('src/App.js') !== -1);
75+
if (!this.appFile) {
76+
throw new Error(`src/App.js file not found. Can't parse dashboard app.`);
77+
}
7578
this.appAst = parse(this.appFile.content, {
7679
sourceFilename: this.appFile.fileName,
7780
sourceType: 'module',
@@ -252,7 +255,7 @@ class DashboardSource {
252255
}
253256

254257
dashboardAppCode() {
255-
return generator(this.appAst, {}, this.appFile.content).code;
258+
return this.appAst && generator(this.appAst, {}, this.appFile.content).code;
256259
}
257260
}
258261

0 commit comments

Comments
 (0)