Skip to content

Commit 94c60db

Browse files
committed
AC-14597: JavaScript error encountered when selecting "All Resources" in API resource access during integration activation
Added the check to avoid console error before applying "removeChild" method
1 parent e5271c3 commit 94c60db

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

app/code/Magento/User/view/adminhtml/web/js/roles-tree.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2013 Adobe
3+
* All rights reserved.
44
*/
55

66
/**
@@ -97,9 +97,13 @@ define([
9797
_destroy: function () {
9898
this.element.jstree('destroy');
9999

100-
this.buttons.forEach(function (element) {
101-
element.parentNode.removeChild(element);
102-
});
100+
if (this.buttons) {
101+
this.buttons.forEach(function (element) {
102+
if (element && element.parentNode) {
103+
element.parentNode.removeChild(element);
104+
}
105+
});
106+
}
103107
},
104108

105109
/**

0 commit comments

Comments
 (0)