Skip to content

Commit

Permalink
Merge pull request #66 from QuickCorp/v2.3
Browse files Browse the repository at this point in the history
prevent undefined pointer in componentList mapping for reroute
  • Loading branch information
jeanmachuca committed Apr 26, 2021
2 parents 7633f2e + 13decb5 commit 8250fef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,8 @@
componentClass.hasOwnProperty.call(componentClass,"subcomponents")) ? (true) : (false);
var __route__ = function(componentList) {
componentList.map(function (rc, r){
if (rc.hasOwnProperty.call(rc,"_reroute_")){
if (typeof rc !== "undefined"
&& rc.hasOwnProperty.call(rc,"_reroute_")){
rc._reroute_();
if (rc.hasOwnProperty.call(rc,"subcomponents") &&
typeof rc.subcomponents !== "undefined" &&
Expand All @@ -1856,7 +1857,7 @@
logger.debug("LOOKING FOR ROUTINGS IN SUBCOMPONENTS FOR: " + rc.name);
__route__.call(componentClass, rc.subcomponents);
}
} else {
} else if (typeof rc !== "undefined"){
logger.debug("IT WAS NOT POSSIBLE TO RE-ROUTE: " + rc.name);
}
});
Expand Down

0 comments on commit 8250fef

Please sign in to comment.