From deda9a69088e7597b1a8455b1624eb82a72d4878 Mon Sep 17 00:00:00 2001 From: acshi Date: Wed, 29 Jun 2016 10:59:48 -0400 Subject: [PATCH] Prevent creation of empty entry in _connectorCache for raw templates. (#4296) --- app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 b/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 index b15685f0e..cd7363d9f 100644 --- a/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 +++ b/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 @@ -86,13 +86,12 @@ function buildConnectorCache() { }); findOutlets(Ember.TEMPLATES, function(outletName, resource, uniqueName) { - _connectorCache[outletName] = _connectorCache[outletName] || []; - const mixin = {templateName: resource.replace('javascripts/', '')}; let viewClass = uniqueViews[uniqueName]; if (viewClass) { // We are going to add it back with the proper template + _connectorCache[outletName] = _connectorCache[outletName] || []; _connectorCache[outletName].removeObject(viewClass); } else { if (!/\.raw$/.test(uniqueName)) { @@ -101,6 +100,7 @@ function buildConnectorCache() { } if (viewClass) { + _connectorCache[outletName] = _connectorCache[outletName] || []; _connectorCache[outletName].pushObject(viewClass.extend(mixin)); } else { // we have a raw template