From ddf44377e8472857a631bf788da4aebd546ffb48 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 4 Feb 2019 17:55:44 +0000 Subject: [PATCH] Fix errors without templates not working --- modules/osm/qa_error.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/osm/qa_error.js b/modules/osm/qa_error.js index b00d6f5b6..ad1b1858a 100644 --- a/modules/osm/qa_error.js +++ b/modules/osm/qa_error.js @@ -40,14 +40,18 @@ _extend(qaError.prototype, { } } - if (this.service) { - this.source = services[this.service].shortName; + // Extract common error information from data + if (this.service && this.error_type) { + var serviceInfo = services[this.service]; - if (this.error_type) { - var template = services[this.service].errorTypes[this.error_type]; + if (serviceInfo) { + var errInfo = serviceInfo.errorTypes[this.error_type]; - this.icon = template.icon; - this.category = template.category; + this.source = serviceInfo.shortName; + if (errInfo) { + this.icon = errInfo.icon; + this.category = errInfo.category; + } } }