Index: /trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java	(revision 13214)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java	(revision 13215)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.GraphicsEnvironment;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -425,5 +426,5 @@
             activeLayerChangeListeners.clear();
             layerAvailabilityListeners.clear();
-        } else {
+        } else if (!GraphicsEnvironment.isHeadless()) {
             GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(MainApplication.parent,
                     tr("A background upload is already in progress. Cannot reset state until the upload is finished.")));
