From fe11a425cdf923673b0244ed3b3bc20a0db018e7 Mon Sep 17 00:00:00 2001 From: Drew Regitsky Date: Thu, 10 Mar 2016 19:06:15 -0800 Subject: [PATCH] fix(templates): fix a null check bug in template contentedtable ext --- internal_packages/composer-templates/lib/template-editor.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal_packages/composer-templates/lib/template-editor.es6 b/internal_packages/composer-templates/lib/template-editor.es6 index 635d4ea79..8c6f86973 100644 --- a/internal_packages/composer-templates/lib/template-editor.es6 +++ b/internal_packages/composer-templates/lib/template-editor.es6 @@ -62,7 +62,7 @@ export default class TemplateEditor extends ContenteditableExtension { // Sets node contents to just its textContent, strips HTML codeNode.textContent = codeNode.textContent; - if (selIndex !== undefined) { + if (selIndex != null) { editor.restoreSelectionByTextIndex(codeNode, selIndex.startIndex, selIndex.endIndex); } }