Skip to content

Commit 7297601

Browse files
committed
Handle the case where there are no executors in the short link (CC @lefticus)
1 parent b315947 commit 7297601

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/clientstate.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ClientStateCompilerOptions {
4949
}
5050
}
5151

52-
class ClientStateCompiler {
52+
class ClientStateCompiler {
5353
constructor(jsondata) {
5454
if (jsondata) {
5555
this.fromJsonData(jsondata);
@@ -71,7 +71,7 @@ class ClientStateCompiler {
7171
} else {
7272
this.id = "";
7373
}
74-
74+
7575
this.options = jsondata.options;
7676
this.filters = new ClientStateCompilerOptions(jsondata.filters);
7777
if (typeof jsondata.libs !== 'undefined') {
@@ -170,9 +170,11 @@ class ClientStateSession {
170170
this.compilers.push(new ClientStateCompiler(compilerdata));
171171
});
172172

173-
jsondata.executors.forEach((executor) => {
174-
this.executors.push(new ClientStateExecutor(executor));
175-
});
173+
if (typeof jsondata.executors !== 'undefined') {
174+
jsondata.executors.forEach((executor) => {
175+
this.executors.push(new ClientStateExecutor(executor));
176+
});
177+
}
176178
}
177179

178180
findOrCreateCompiler(id) {

0 commit comments

Comments
 (0)