Scinotes: fix a npe when opening a new tab with ctrl+N 97/7797/2
Calixte DENIZET [Sun, 8 Jul 2012 15:20:33 +0000 (17:20 +0200)]
Change-Id: I7dd71b9f9bf6ad88c4b04dc7c4cd53905d82d5d0

scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/ScilabEditorPane.java

index 768e945..65bfdb4 100644 (file)
@@ -414,7 +414,7 @@ public class ScilabEditorPane extends JEditorPane implements Highlighter.Highlig
      * @param e the event
      */
     public void keyReleased(KeyEvent e) {
-        if (e.getKeyCode() == KeyEvent.VK_CONTROL) {
+        if (mousePoint != null && e.getKeyCode() == KeyEvent.VK_CONTROL) {
             ctrlHit = false;
             preventConcernedKeywordListener(viewToModel(mousePoint), e, KeywordListener.ONMOUSEOVER);
         }