compute initial state of placeholder correctly
[idea/community.git] / python / educational-core / student / src / com / jetbrains / edu / learning / courseFormat / TaskFile.java
index 1223f43f3d10bb17cadfde3953b55c2692ca054a..31eb6f19a7435548496718ad889b5d33eccfacbc 100644 (file)
@@ -99,7 +99,9 @@ public class TaskFile {
       answerPlaceholderCopy.setIndex(answerPlaceholder.getIndex());
       answerPlaceholderCopy.setHint(answerPlaceholder.getHint());
       final AnswerPlaceholder.MyInitialState state = answerPlaceholder.getInitialState();
-      answerPlaceholderCopy.setInitialState(new AnswerPlaceholder.MyInitialState(state.getOffset(), state.getLength()));
+      if (state != null) {
+        answerPlaceholderCopy.setInitialState(new AnswerPlaceholder.MyInitialState(state.getOffset(), state.getLength()));
+      }
       answerPlaceholdersCopy.add(answerPlaceholderCopy);
     }
     target.name = source.name;