From 96d269e348e7a08c2fbcd76eceb480c78f036dfe Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Mon, 3 Jul 2017 15:13:27 +0100 Subject: [PATCH] Use existential operator to check existence --- .../aceEditor/auto-complete/AutoCompleteManager.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee index 60164782f7..1669308762 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee @@ -183,11 +183,11 @@ define [ editor.session.remove(right); # trim the completion text to just the command, without braces # example: '\cite{}' -> '\cite' - if matchData.snippet + if matchData.snippet? matchData.snippet = matchData.snippet.replace(/[{\[].*[}\]]/, '') - if matchData.caption + if matchData.caption? matchData.caption = matchData.caption.replace(/[{\[].*[}\]]/, '') - if matchData.value + if matchData.value? matchData.value = matchData.value.replace(/[{\[].*[}\]]/, '') # finally, insert the match if matchData.snippet