Procházet zdrojové kódy

Fixes #1520 Check for null object before accessing it

This is not related to the thor changes but a side effect of the fix for
#806 which had to do with displaying optional attributes not present in
the environment. In this case, slavesPerNode is a required attribute, which
caused a variable evaluate to null. Added a check for null object before accessing it.

Signed-off-by: Sridhar Meda <sridhar.meda@lexisnexis.com>
Sridhar Meda před 13 roky
rodič
revize
8c60252ca6
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      esp/files/scripts/configmgr/configmgr.js

+ 1 - 1
esp/files/scripts/configmgr/configmgr.js

@@ -3456,7 +3456,7 @@ function updateParams(record, attrName, oldValue, newValue, updateAttr, prevVal,
           }
           record.setData(subrec, sub);
         }
-        else {
+        else if (sub){
           var sparams = sub.params;
           var newsparams = updateParams(null, attrName, oldValue, newValue, updateAttr, prevVal, updateVal, sparams);
           if (newsparams.length > 0)