Ignore:
Timestamp:
2021-08-25T20:11:20+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #20385 - check for empty ways

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java

    r35204 r35811  
    296296            final Way to = TurnlanesUtils.getMemberWay(r, Constants.TURN_ROLE_TO);
    297297
    298             if (from.firstNode().equals(from.lastNode())) {
    299                 issues.add(Issue.newError(r, from, "The from-way both starts as well as ends at the via-node."));
    300             }
    301             if (to.firstNode().equals(to.lastNode())) {
    302                 issues.add(Issue.newError(r, to, "The to-way both starts as well as ends at the via-node."));
     298            if (from.isEmpty()) {
     299                issues.add(Issue.newError(r, from, tr("The from-way is empty.")));
     300            } else if (from.firstNode().equals(from.lastNode())) {
     301                issues.add(Issue.newError(r, from, tr("The from-way both starts as well as ends at the via-node.")));
     302            }
     303            if (to.isEmpty()) {
     304                issues.add(Issue.newError(r, from, tr("The to-way is empty.")));
     305            } else if (to.firstNode().equals(to.lastNode())) {
     306                issues.add(Issue.newError(r, to, tr("The to-way both starts as well as ends at the via-node.")));
    303307            }
    304308            if (!issues.isEmpty()) {
     
    327331
    328332                if (!from.isFirstLastNode(via)) {
    329                     issues.add(Issue.newError(r, from, "The from-way does not start or end at the via-node."));
     333                    issues.add(Issue.newError(r, from, tr("The from-way does not start or end at the via-node.")));
    330334                }
    331335                if (!to.isFirstLastNode(via)) {
    332                     issues.add(Issue.newError(r, to, "The to-way does not start or end at the via-node."));
     336                    issues.add(Issue.newError(r, to, tr("The to-way does not start or end at the via-node.")));
    333337                }
    334338
Note: See TracChangeset for help on using the changeset viewer.