Changeset 14553 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2018-12-11T23:49:14+01:00 (6 years ago)
Author:
Don-vip
Message:

see #16073 - avoid unnamed layers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java

    r14551 r14553  
    313313    private static List<LayerDetails> firstLeafLayer(List<LayerDetails> layers) {
    314314        for (LayerDetails layer : layers) {
    315             if (layer.getChildren().isEmpty()) {
     315            boolean hasNoChildren = layer.getChildren().isEmpty();
     316            if (hasNoChildren && layer.getName() != null) {
    316317                return Collections.singletonList(layer);
    317             } else {
     318            } else if (!hasNoChildren) {
    318319                return firstLeafLayer(layer.getChildren());
    319320            }
    320321        }
    321         return Collections.emptyList();
     322        throw new IllegalArgumentException("Unable to find a valid WMS layer");
    322323    }
    323324
Note: See TracChangeset for help on using the changeset viewer.