EDU-224 NPE on right click in test_helper
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Tue, 14 Oct 2014 14:57:56 +0000 (18:57 +0400)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Tue, 14 Oct 2014 14:57:56 +0000 (18:57 +0400)
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/actions/CCAddTaskWindow.java

index 9555de7e2e170a286ced70d10bb6406353a55a53..70fc53ea727da84dded48af4bec0cf0e761b846b 100644 (file)
@@ -100,6 +100,11 @@ public class CCAddTaskWindow extends DumbAwareAction {
     if (lessonDir == null) return;
 
     final Lesson lesson = course.getLesson(lessonDir.getName());
+    if (lesson == null) {
+      presentation.setVisible(false);
+      presentation.setEnabled(false);
+      return;
+    }
     final Task task = lesson.getTask(taskDir.getName());
     if (task == null) {
       presentation.setVisible(false);