Fix two potential exceptions and one lint warning

This commit is contained in:
Quincy Morgan
2019-05-02 16:26:33 -07:00
parent 10d5c627d6
commit bfc944e30a
3 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -314,7 +314,8 @@ export function coreValidator(context) {
// detect new issues and update caches
entityIDsToCheck.forEach(function(entityID) {
var entity = graph.entity(entityID);
var entity = graph.hasEntity(entityID);
if (!entity) return;
var issues = validateEntity(entity);
issues.forEach(function(issue) {
+1 -1
View File
@@ -3,7 +3,7 @@ import { utilDisplayLabel } from '../util';
import { t } from '../util/locale';
import { validationIssue, validationIssueFix } from '../core/validation';
import { osmRoutableHighwayTagValues } from '../osm/tags';
import { geoExtent, geoSphericalDistance } from '../geo';
import { geoSphericalDistance } from '../geo';
export function validationCloseNodes() {
+3 -2
View File
@@ -23,10 +23,11 @@ export function validationDisconnectedWay() {
var entityLabel = utilDisplayLabel(entity, context);
var fixes = [];
var entityID = entity.id;
var firstID = entity.first();
var lastID = entity.last();
if (entity.type === 'way' && !entity.isClosed()) {
var firstID = entity.first();
var lastID = entity.last();
var first = context.entity(firstID);
if (first.tags.noexit !== 'yes') {
fixes.push(new validationIssueFix({