[Angular] Check for context capability

Check for existence of context capability from Remove action
during navigation check. This avoids an exception that
appears to have been swallowed in earlier versions of
Angular.
This commit is contained in:
Victor Woeltjen
2015-09-09 17:25:02 -07:00
parent 52df7fe1e2
commit c6df7cebe5

View File

@ -90,7 +90,8 @@ define(
*/
function checkObjectNavigation(object, parentObject) {
// Traverse object starts at current location
var traverseObject = (navigationService).getNavigation();
var traverseObject = (navigationService).getNavigation(),
context;
// Stop when object is not defined (above ROOT)
while (traverseObject) {
@ -103,7 +104,8 @@ define(
}
// Traverses to parent of current object, moving
// up the ascendant path
traverseObject = traverseObject.getCapability('context').getParent();
context = traverseObject.getCapability('context');
traverseObject = context && context.getParent();
}
}