From 850a24cc041a67052e857e2c861cdb68efbe3cae Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Mon, 8 Jan 2024 08:36:48 +0100 Subject: [PATCH] Fix error linking text in tinymce When the text does not have a link yet and also is a object from tinymce editor it does not have the getAttribute function. We can simply check for its existance. --- app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee b/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee index 7c7f4ec9c8..a90a55179c 100644 --- a/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +++ b/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee @@ -154,7 +154,7 @@ class window.Alchemy.LinkDialog extends Alchemy.Dialog @$link = $(@link_object.node) @link_object.selection.moveToBookmark(@link_object.bookmark) # Creating an temporary anchor node if we are linking an Picture Ingredient. - else if @link_object.getAttribute("is") == "alchemy-link-button" + else if @link_object.getAttribute && @link_object.getAttribute("is") == "alchemy-link-button" @$link = $(@createTempLink()) else return false