Changeset 11594 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2017-02-21T22:58:57+01:00 (7 years ago)
Author:
Don-vip
Message:

see #14381 - don't try to display message dialog on headless environment if a test can't be initialized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r11136 r11594  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.awt.GraphicsEnvironment;
    67import java.io.File;
    78import java.io.FileNotFoundException;
     
    334335            } catch (Exception e) {
    335336                Main.error(e);
    336                 JOptionPane.showMessageDialog(Main.parent,
    337                         tr("Error initializing test {0}:\n {1}", test.getClass()
    338                                 .getSimpleName(), e),
    339                                 tr("Error"),
    340                                 JOptionPane.ERROR_MESSAGE);
     337                if (!GraphicsEnvironment.isHeadless()) {
     338                    JOptionPane.showMessageDialog(Main.parent,
     339                            tr("Error initializing test {0}:\n {1}", test.getClass().getSimpleName(), e),
     340                            tr("Error"), JOptionPane.ERROR_MESSAGE);
     341                }
    341342            }
    342343        }
Note: See TracChangeset for help on using the changeset viewer.