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

Commit ab23459

Browse files
committed
server: Fix script execution error (closes #244)
1 parent 40363f6 commit ab23459

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/services/backend_script_api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ interface Api {
6363
* Note where the script started executing (entrypoint).
6464
* As an analogy, in C this would be the file which contains the main() function of the current process.
6565
*/
66-
startNote?: BNote;
66+
startNote?: BNote | null;
6767

6868
/**
6969
* Note where the script is currently executing. This comes into play when your script is spread in multiple code
@@ -76,7 +76,7 @@ interface Api {
7676
/**
7777
* Entity whose event triggered this execution
7878
*/
79-
originEntity?: AbstractBeccaEntity<any>;
79+
originEntity?: AbstractBeccaEntity<any> | null;
8080

8181
/**
8282
* Axios library for HTTP requests. See {@link https://axios-http.com} for documentation

src/services/backend_script_api_interface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import AbstractBeccaEntity = require("../becca/entities/abstract_becca_entity");
33
import BNote = require("../becca/entities/bnote");
44

55
export interface ApiParams {
6-
startNote?: BNote;
7-
originEntity?: AbstractBeccaEntity<any>;
6+
startNote?: BNote | null;
7+
originEntity?: AbstractBeccaEntity<any> | null;
88
pathParams?: string[],
99
req?: Request,
1010
res?: Response

src/services/script.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ function executeScript(script: string, params: ScriptParams, startNoteId: string
9595
throw new Error("Unable to determine script bundle.");
9696
}
9797

98-
if (!startNote || !originEntity) {
99-
throw new Error("Missing start note or origin entity.");
100-
}
101-
10298
return executeBundle(bundle, { startNote, originEntity });
10399
}
104100

0 commit comments

Comments
 (0)