diff --git a/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/model/XtextDocument.java b/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/model/XtextDocument.java index 312b83b85c6..98556b09633 100755 --- a/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/model/XtextDocument.java +++ b/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/model/XtextDocument.java @@ -563,6 +563,9 @@ protected T internalReadOnly(IUnitOfWork work, boolean isC * changing while they run. To achieve this, we run the {@link IXtextModelListener}s on the UI thread. */ private void notifyModelListenersOnUiThread() { + if(modelListeners.isEmpty()) { + return; + } Display display = PlatformUI.getWorkbench().getDisplay(); if (Thread.currentThread() == display.getThread()) { // We are already running on the display thread. Run the listeners immediately.