diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index b7ea67ba..7e9d2b69 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -28,8 +28,8 @@ export default { isFlagSelector() { const field = this.get('field'); //TODO improve the way this detects a flag dropdown (currently it relies on the string 'Nation', e.g. 'Nationality' or 'National Flag' appearing in label) - return (field.label.includes(Discourse.SiteSettings.wizard_national_flags_label_cue)) ? true : false; - } + return (typeof field.label !== 'undefined') ? (field.label.includes(Discourse.SiteSettings.wizard_national_flags_label_cue)) ? true : false : false; + } }); diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index e2c2d856..dd36b72f 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -23,3 +23,4 @@ en: site_settings: wizard_redirect_exclude_paths: "Routes excluded from wizard redirects." wizard_recognised_image_upload_formats: "File types which will result in upload displaying an image preview" + wizard_national_flags_label_cue: "The characters that must appear in the dropdown field label for it to show a flag" \ No newline at end of file