Skip to content

Commit 660e132

Browse files
committed
fix: add check for blank content before loading workflow context from file
1 parent 13e52f1 commit 660e132

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/mindustrytool/workflow/Workflow.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ public void writeWorkflowData(JsonNode data) {
115115

116116
private void loadWorkflowFromFile() {
117117
String content = WORKFLOW_FILE.readString();
118-
context = JsonUtils.readJsonAsClass(content, WorkflowContext.class);
119-
load(context);
118+
if (!content.isBlank()) {
119+
context = JsonUtils.readJsonAsClass(content, WorkflowContext.class);
120+
load(context);
121+
}
120122
}
121123

122124
private void writeWorkflowToFile() {

0 commit comments

Comments
 (0)