From bec7472c191dde4b572dd57ca5015fe0dc58aced Mon Sep 17 00:00:00 2001 From: Vlad Topala Date: Mon, 26 Oct 2015 19:59:28 +0200 Subject: [PATCH] TG-3344 Comment is edited if you cancel add link dialog When dialog is canceled, the result will be null because there is no start of link "<<<" inserted. In this case we shouldn't search for the end of the link and just return. --- app/coffee/modules/common/wisiwyg.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/coffee/modules/common/wisiwyg.coffee b/app/coffee/modules/common/wisiwyg.coffee index 2918ffc1..2bf6a444 100644 --- a/app/coffee/modules/common/wisiwyg.coffee +++ b/app/coffee/modules/common/wisiwyg.coffee @@ -149,6 +149,8 @@ MarkitupDirective = ($rootscope, $rs, $selectedText, $template, $compile, $trans startIndex = result.index break + return if !result + regex = />>>/gi endIndex = 0 loop