Skip to content

Commit f584097

Browse files
authored
Merge pull request #1686 from tom-anders/studyIllegalPosition
fix: studies with illegal positions
2 parents 16b8d22 + a1fb05d commit f584097

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/model/study/study_controller.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ class StudyController extends _$StudyController
139139
isOnMainline: true,
140140
root: null,
141141
currentNode: StudyCurrentNode.illegalPosition(),
142-
evaluationContext: EvaluationContext(variant: variant, initialPosition: _root.position),
142+
// EvaluationContext needs an initial posiiton, but it doesn't matter what we pass here,
143+
// since the position is illegal and `isComputerAnalysisAllowed` is false anyway.
144+
evaluationContext: EvaluationContext(
145+
variant: variant,
146+
initialPosition: study.chapter.setup.variant.initialPosition,
147+
),
143148
pgnRootComments: rootComments,
144149
pov: orientation,
145150
isComputerAnalysisAllowed: false,

0 commit comments

Comments
 (0)