From c330df915ff0c2ad7d769d713acc4e6eb849d628 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 7 Nov 2016 09:15:49 -0700 Subject: [PATCH] Avoid JS error if value is undefined --- api/js/etemplate/et2_widget_link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_link.js b/api/js/etemplate/et2_widget_link.js index 7df7037145..e34ba155a0 100644 --- a/api/js/etemplate/et2_widget_link.js +++ b/api/js/etemplate/et2_widget_link.js @@ -185,7 +185,7 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend( }; // only set server-side callback, if we have a real application-id (not null or array) // otherwise it only gives an error on server-side - if (self.options.value.to_id && typeof self.options.value.to_id != 'object') { + if (self.options.value && self.options.value.to_id && typeof self.options.value.to_id != 'object') { select_attrs.method = 'EGroupware\\Api\\Etemplate\\Widget\\Link::link_existing'; select_attrs.method_id = self.options.value.to_app + ':' + self.options.value.to_id; }