Skip to content

Commit c551d6d

Browse files
committed
Fixes NoSuchElement when previewing a Source then a Step
Closes #234
1 parent 1583fc7 commit c551d6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/src/main/java/edu/wpi/grip/ui/preview/PreviewsController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private int getIndexInPreviewsOfAStepSocket(OutputSocket<?> socket) {
219219
//Start at the first non-source socket in the list of previewed sockets
220220
long indexInPreviews =
221221
// The socket at this index in the list of displayed sockets has an index in the pipeline less than the socket passed in as "socket"
222-
this.previewedSockets.stream().filter(outSocket -> this.pipeline.getSteps().indexOf(outSocket.getStep().get()) < indexOfStep).count();
222+
this.previewedSockets.stream().filter(outSocket -> outSocket.getStep().isPresent() && this.pipeline.getSteps().indexOf(outSocket.getStep().get()) < indexOfStep).count();
223223
return IntMath.checkedAdd(Math.toIntExact(indexInPreviews), numbOfSourcePreviews);
224224
}
225225

0 commit comments

Comments
 (0)