From 4a1c548e5b08175cde2ca2f39b4e0fb7b8b12586 Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Tue, 14 Mar 2017 05:05:59 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20ensure=20tag=20property=20exists?= =?UTF-8?q?=20before=20trying=20to=20trim=20it=20(#578)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - fixes error thrown when you focus in/focus out of a field in the tags editor without entering anything --- ghost/admin/app/controllers/settings/tags/tag.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/controllers/settings/tags/tag.js b/ghost/admin/app/controllers/settings/tags/tag.js index c03ec25acf..882bb47148 100644 --- a/ghost/admin/app/controllers/settings/tags/tag.js +++ b/ghost/admin/app/controllers/settings/tags/tag.js @@ -18,7 +18,9 @@ export default Controller.extend({ let tag = this.get('tag'); let currentValue = tag.get(propKey); - newValue = newValue.trim(); + if (newValue) { + newValue = newValue.trim(); + } // Quit if there was no change if (newValue === currentValue) {