You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by vo...@apache.org on 2023/02/07 18:56:18 UTC

[myfaces] branch main updated: JavaScript: Check if getAttribute is a function before calling it

This is an automated email from the ASF dual-hosted git repository.

volosied pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/main by this push:
     new b303601df JavaScript: Check if getAttribute is a function before calling it
     new 3f3393249 Merge pull request #511 from volosied/js-workaround
b303601df is described below

commit b303601df526f6c3eeb24754c1caddc99d95fa3f
Author: Volodymyr Siedlecki <vo...@gmail.com>
AuthorDate: Mon Feb 6 15:44:21 2023 -0500

    JavaScript: Check if getAttribute is a function before calling it
---
 .../META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js           | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js b/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js
index c140788be..0b6ce12b3 100644
--- a/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js
+++ b/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js
@@ -186,7 +186,10 @@ _MF_SINGLTN(_PFX_XHR+"_AjaxUtils", _MF_OBJECT,
         form = this._Dom.byId(form);
         var _t = this;
         var foundNames = this._Dom.findAll(form, function(node) {
-            var name = node.getAttribute("name");
+            var name;
+            if (typeof node.getAttribute === 'function') {
+                name = node.getAttribute("name")
+            }
             if(!name || name.indexOf("jakarta.faces.ViewState") <= 0) {
                 return false;
             }