[Rt-commit] rt branch, master, updated. rt-4.2.11-173-ge7f09e3

? sunnavy sunnavy at bestpractical.com
Thu Sep 10 10:31:56 EDT 2015


The branch, master has been updated
       via  e7f09e3512fa9475836139b423ef67728f96ce86 (commit)
      from  a86889466012e5721aec13165eca81f8fd6add45 (commit)

Summary of changes:
 share/static/js/util.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit e7f09e3512fa9475836139b423ef67728f96ce86
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Sep 10 22:06:48 2015 +0800

    check container's existance before calling it
    
    container could be undefined if input doesn't exist or we can't find related
    parent. when this happens, js will error out "container is undefined"
    
    this is initially for the call of "setCheckbox(txn_send_field);", where
    txn_send_field could be an empty jQuery object

diff --git a/share/static/js/util.js b/share/static/js/util.js
index 6cc2acf..1dfc2b6 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -83,7 +83,12 @@ function set_rollup_state(e,e2,state) {
 function getClosestInputElements(input) {
     // Find inputs within the current form or collection list, whichever is closest.
     var container = jQuery(input).closest("form, table.collection-as-table").get(0);
-    return container.getElementsByTagName('input');
+    if ( container ) {
+        return container.getElementsByTagName('input');
+    }
+    else {
+        return [];
+    }
 }
 
 function setCheckbox(input, name, val) {

-----------------------------------------------------------------------


More information about the rt-commit mailing list