Skip to content

Commit

Permalink
fix: Fix NPE when run without cucumber scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-gryzbon committed Mar 23, 2023
1 parent f355256 commit 4455f39
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/lsd/cucumber/LsdCucumberPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.lsd.LsdContext;
import io.cucumber.plugin.EventListener;
import io.cucumber.plugin.event.*;
import org.junit.platform.commons.util.StringUtils;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -108,8 +109,10 @@ private boolean isVeryFirstRun() {
}

private void handleTestRunFinished(TestRunFinished event) {
finishProcessingCompletedScenario();
lsdContext.completeReport(featureName);
lsdContext.createIndex();
if (!StringUtils.isBlank(featureName)) {
finishProcessingCompletedScenario();
lsdContext.completeReport(featureName);
lsdContext.createIndex();
}
}
}

0 comments on commit 4455f39

Please sign in to comment.