Changeset 943


Ignore:
Timestamp:
Nov 14, 2010, 6:33:14 PM (7 years ago)
Author:
stefan
Message:

fixed another bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/codehelper/BackgroundParser.java

    r938 r943  
    7777  public void run() {
    7878    while (true) {
    79       SourceCodeEditor<Doc> editor;
     79      SourceCodeEditor<Doc> editor = null;
    8080      try {
    8181        editor = jle.getMainEditor();
    82       } catch (ArrayIndexOutOfBoundsException e) {
    83         try {
    84           sleep(1000);
    85         } catch (InterruptedException e2) {
    86           return;
    87         }
    88         continue;
     82      } catch (ArrayIndexOutOfBoundsException ignored) {
     83      } catch (NullPointerException ignored) {
    8984      }
    90       AbstractResource resource = editor.getResource();
    91       if (!(resource instanceof Doc.FileDoc)) {
     85
     86      AbstractResource resource = null;
     87      if (editor != null) {
     88        resource = editor.getResource();
     89      }
     90
     91      // wait a second if we could not determine a saved master document
     92      if (resource == null || !(resource instanceof Doc.FileDoc)) {
    9293        try {
    9394          sleep(1000);
Note: See TracChangeset for help on using the changeset viewer.